Class ComponentResolver<T extends Component>
java.lang.Object
io.github.kaktushose.jdac.message.resolver.ComponentResolver<T>
- Type Parameters:
T- a subtype ofComponentto resolve
- All Implemented Interfaces:
Resolver<T>
Resolver implementation that can resolve any Component. This will only resolve the textual fields of components,
namely:
contentlabelplaceholdervalue
As with other Resolvers, this class is 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.
-
Constructor Summary
ConstructorsConstructorDescriptionComponentResolver(Resolver<String> resolver, Class<T> type) Constructs a new ComponentResolver. -
Method Summary
Modifier and TypeMethodDescriptionintpriority()The priority of this resolver influences the order in which resolver are applied in a resolution pipeline.Resolves aCollectionofComponents.Resolves aComponent.
-
Constructor Details
-
ComponentResolver
-
-
Method Details
-
resolve
public Collection<T> resolve(Collection<T> components, Locale locale, Map<String, @Nullable Object> placeholders) - Parameters:
components- theComponents to resolvelocale- theLocaleto use for localizationplaceholders- the placeholders to use if supported by the used StringResolver- Returns:
- the
Collectionof resolvedComponents
-
resolve
Resolves aComponent.FileUploads will be preserved. -
priority
public int priority()Description copied from interface:ResolverThe 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.
-