Class IdMapping<T>

java.lang.Object
xyz.dynxsty.dih4jda.interactions.components.IdMapping<T>
Type Parameters:
T - The handlers type.

public class IdMapping<T> extends Object
Simple POJO that holds a handler, IdMapping, and an array of Strings.
  • Method Details

    • of

      @Nonnull public static <T> IdMapping<T> of(@Nonnull T handler, @Nonnull String... ids)
      Creates a new IdMapping with the specified handler and ids.
      Type Parameters:
      T - The IdMappings type.
      Parameters:
      handler - The corresponding handler class.
      ids - An String array of component ids.
      Returns:
      The IdMapping instance.
    • getIds

      @Nonnull public String[] getIds()
      Gets you the ids that linked themselves with their getHandler().
      Returns:
      the ids as an String array.
    • getHandler

      @Nonnull public T getHandler()
      Gets you the handler that was linked with the getIds().
      Returns:
      the handler instance.