Class ComponentIdBuilder

java.lang.Object
xyz.dynxsty.dih4jda.util.ComponentIdBuilder

public class ComponentIdBuilder extends Object
Utility class that allows for easy and consistent Component-ID building.
Since:
v1.4
  • Method Details

    • build

      @Nonnull public static String build(@Nonnull String identifier, @Nonnull Object... args)
      Builds a component-id using the (set) separator and the given identifier and arguments.
      
       Button.secondary(ComponentIdBuilder.build("self-role", roleId), "Click me!");
       
      Parameters:
      identifier - The component's identifier.
      args - An optional parameter for arguments.
      Returns:
      The built component-id, as a String.
      Since:
      v1.4
    • split

      @Nonnull public static String[] split(@Nonnull String id)
      Splits the given id by the current separator.
      Parameters:
      id - The component-id that should be split.
      Returns:
      The split String as an array.
      Since:
      v1.4