Class ComponentResolver<T extends net.dv8tion.jda.api.components.Component>
java.lang.Object
io.github.kaktushose.jdac.message.resolver.ComponentResolver<T>
- Type Parameters:
T- a subtype ofComponentto resolve
- All Implemented Interfaces:
Resolver<T>
public final class ComponentResolver<T extends net.dv8tion.jda.api.components.Component>
extends Object
implements 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
-
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.- Specified by:
resolvein interfaceResolver<T extends net.dv8tion.jda.api.components.Component>- Parameters:
component- theComponentto resolvelocale- theLocaleto use for localizationplaceholders- the placeholders to use if supported by the used StringResolver- Returns:
- the resolved
Component
-