Package xyz.dynxsty.dih4jda.util
Class ComponentIdBuilder
java.lang.Object
xyz.dynxsty.dih4jda.util.ComponentIdBuilder
Utility class that allows for easy and consistent Component-ID building.
- Since:
- v1.4
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringBuilds a component-id using the (set) separator and the given identifier and arguments.static StringGets the current separator.static voidsetDefaultSeparator(String separator) Changes the default component-id separator.static String[]Splits the given id by the current separator.
-
Method Details
-
setDefaultSeparator
Changes the default component-id separator.- Parameters:
separator- The string that should act as the separator.- Since:
- v1.4
-
getSeparator
Gets the current separator.- Returns:
- The separator.
- Since:
- v1.4
-
build
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
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
-