Interface Property<T>
- All Known Implementing Classes:
Property.Enumeration, Property.Map, Property.Singleton
public sealed interface Property<T>
permits Property.Enumeration<E>, Property.Singleton<T>, Property.Map<K,V>
Properties
An Property represent either...
- a config option to adjust the behaviour of JDA-Commands (like
JDACBuilder.shutdownJDA(boolean)) - an implementation of exposed services (like
Localizer) - or a service provided by the framework that are exposed to the user (like
I18n)
Although the user can provide custom values for these properties, the properties itself are all defined by the JDA-Commands and exposed as public static fields in this interface.
Categories
Properties are primarily categorized by 3 groups:
- user settable -> only configurable by using the designated
JDACBuildermethod - user settable + loadable from extension -> above applies plus values can be provided by
Extensions - provided -> service that are provided by JDA-Commands, the user can use but not create/replace them
Types
Additionally, there are 3 types of properties:
Property.Singleton-> the property will have the value of the provider with the highest priorityProperty.Map-> the property represents a Map with a key and value. The value of all providers will be accumulated and providers with higher priorities take precedenceProperty.Enumeration-> the property represents aCollection. The value of all providers will be accumulated
The only exception to this general accumulation rule are fallback values. Whether they are accumulated with other
providers or overwritten is defined by fallbackBehaviour().
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe category of a property defines how values for it can be provided.static final recordAProperty.Enumerationproperty basically represents aCollectionof multiple values.static enumThe fallback behaviour defines whether the fallback value provided by JDA-Commands should be accumulated together with the user defined ones or overwritten.static final recordAProperty.Mapproperty basically represents aMap, where each value belongs target a specific key.static final recordAProperty.Singletonproperty just hols one value. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Property<Collection<ClassFinder>> static final Property<Descriptor> static final Property<Consumer<EmbedConfig>> static final Property<EmojiResolver> TheEmojiResolverservice provided by JDA-Commands.static final Property<Collection<EmojiSource>> static final Property<ErrorMessageFactory> static final Property<ExpirationStrategy> static final Property<Map<Class<? extends Extension.Data>, Extension.Data>> static final Property<ExtensionFilter> static final Property<CommandDefinition.CommandConfig> static final Property<InteractionDefinition.ReplyConfig> static final Property<GuildScopeProvider> TheI18nservice provided by JDA-Commands.static final Property<InteractionControllerInstantiator> static final Collection<Property<?>> A collection consisting of allPropertys that are settable by the user and loadable through extensionsstatic final Property<ClassFinder> static final Property<MessageResolver> TheMessageResolverservice provided byt JDA-Commands.static final Property<Collection<Map.Entry<Priority, Middleware>>> MIDDLEWARE property holds multipleMiddlewares associated with theirPrioritystatic final Property<Collection<String>> static final Property<PermissionsProvider> static final Collection<Property<?>> A collection consisting of allPropertys that are provided by JDA-Commandsstatic final Property<Map<AdapterType<?, ?>, TypeAdapter<?, ?>>> The TYPE_ADAPTER property mapsAdapterTypes containing the source and targetsTypes to their associatedTypeAdapterstatic final Collection<Property<?>> A collection consisting of allPropertys that are settable by the userstatic final Property<Map<Class<? extends Annotation>, Validator<?, ?>>> The VALIDATOR property maps aValidatorto its identifying annotation. -
Method Summary
Modifier and TypeMethodDescriptioncategory()The category of the property defines the way a value for it can be provided.Whether the fallback values provided by JDA-Commands should be accumulated together with other user providedPropertyProviders for this property.name()The name of the property is a user and machine-readable unique identifier for a property
-
Field Details
-
CLASS_FINDER
- See Also:
-
EMOJI_SOURCES
- See Also:
-
DESCRIPTOR
- See Also:
-
LOCALIZER
-
INTERACTION_CONTROLLER_INSTANTIATOR
- See Also:
-
MIDDLEWARE
MIDDLEWARE property holds multipleMiddlewares associated with theirPriority- See Also:
-
TYPE_ADAPTER
The TYPE_ADAPTER property mapsAdapterTypes containing the source and targetsTypes to their associatedTypeAdapter- See Also:
-
VALIDATOR
-
PERMISSION_PROVIDER
- See Also:
-
ERROR_MESSAGE_FACTORY
- See Also:
-
GUILD_SCOPE_PROVIDER
- See Also:
-
GLOBAL_COMMAND_CONFIG
- See Also:
-
GLOBAL_REPLY_CONFIG
- See Also:
-
PACKAGES
- See Also:
-
EXPIRATION_STRATEGY
- See Also:
-
LOCALIZE_COMMANDS
-
SHUTDOWN_JDA
-
EXTENSION_DATA
- See Also:
-
EXTENSION_FILTER
- See Also:
-
EMBED_CONFIG
- See Also:
-
I18N
- Implementation Note:
- the
PropertyProviderfor this value is defined in the constructor ofJDACBuilder
-
MESSAGE_RESOLVER
- Implementation Note:
- the
PropertyProviderfor this value is defined in the constructor ofJDACBuilder
-
EMOJI_RESOLVER
TheEmojiResolverservice provided by JDA-Commands. Needs the value ofEMOJI_RESOLVER.- Implementation Note:
- the
PropertyProviderfor this value is defined in the constructor ofJDACBuilder
-
MERGED_CLASS_FINDER
AnClassFinderinstance that is backed by allClassFinderofCLASS_FINDER. It will search in all registeredClassFinderfor the requested class.- Implementation Note:
- the
PropertyProviderfor this value is defined in the constructor ofJDACBuilder
-
LOADABLE
A collection consisting of allPropertys that are settable by the user and loadable through extensions- See Also:
-
USER_SETTABLE
A collection consisting of allPropertys that are settable by the user- See Also:
-
PROVIDED
A collection consisting of allPropertys that are provided by JDA-Commands- See Also:
-
-
Method Details
-
fallbackBehaviour
Property.FallbackBehaviour fallbackBehaviour()Whether the fallback values provided by JDA-Commands should be accumulated together with other user providedPropertyProviders for this property.- Returns:
- the fallback behaviour
-
name
String name()The name of the property is a user and machine-readable unique identifier for a property- Returns:
- the name of the property
-
category
Property.Category category()The category of the property defines the way a value for it can be provided.- Returns:
- the category of the property
-