Interface Resolver<T>

Type Parameters:
T - the type to resolve
All Known Implementing Classes:
ComponentResolver, DataObjectResolver, JsonResolver, MessageResolver
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Resolver<T>

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 Type
    Method
    Description
    resolve(T object, Locale locale, Map<String, @Nullable Object> placeholders)
    Resolves the given object for the provided locale.
  • Method Details

    • resolve

      T resolve(T object, Locale locale, Map<String, @Nullable Object> placeholders)
      Resolves the given object for the provided locale.
      Parameters:
      object - the object to resolve
      locale - the Locale to use for localization
      placeholders - the placeholders to use if supported by the used localization system
      Returns:
      the resolved object