Interface Resolver<T>
- Type Parameters:
T- the type to resolve
- All Known Implementing Classes:
ComponentResolver, DataObjectResolver, EmojiResolver, I18n, JsonResolver, MessageResolver, PlaceholderResolver
Common interface for all resolvers of JDA-Commands.
A Resolver takes an arbitrary object and transforms it to a state, where it can be sent to the Discord API. For
instance, the MessageResolver will take a String as input and then apply placeholders, localization and resolve
any emoji references. Other Resolver implementations are responsible for more complex objects,
like components.
Most Resolvers are not intended to be directly used by end users but part of the public api to allow manual execution of the frameworks resolving logic for dynamic values if needed.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintpriority()The priority of this resolver influences the order in which resolver are applied in a resolution pipeline.default TResolves the given object for the provided locale.Resolves the given object for the provided locale.default Tresolve(T object, DiscordLocale locale, Entry... placeholders) Resolves the given object for the provided locale.default TResolves the given object for the provided locale.
-
Method Details
-
resolve
Resolves the given object for the provided locale.- Parameters:
object- the object to resolvelocale- theLocaleto use for localizationplaceholders- the placeholders to use if supported by the used localization system- Returns:
- the resolved object
-
resolve
Resolves the given object for the provided locale.- Parameters:
object- the object to resolvelocale- theLocaleto use for localizationplaceholders- the placeholders to use if supported by the used localization system- Returns:
- the resolved object
-
resolve
Resolves the given object for the provided locale.- Parameters:
object- the object to resolvelocale- theDiscordLocaleto use for localizationplaceholders- the placeholders to use if supported by the used localization system- Returns:
- the resolved object
-
resolve
Resolves the given object for the provided locale.- Parameters:
object- the object to resolvelocale- theDiscordLocaleto use for localizationplaceholders- the placeholders to use if supported by the used localization system- Returns:
- the resolved object
-
priority
int priority()The priority of this resolver influences the order in which resolver are applied in a resolution pipeline.
Currently, this only applies to
Resolver<String>, when usingMessageResolver(as JDA-Commands does internally). Generally speaking, resolvers with lower priority run first.If the priority isn't important (e.g. for
ComponentResolver) this should return0.- Returns:
- the priority of this resolver
-