Record Class CustomId
java.lang.Object
java.lang.Record
io.github.kaktushose.jdac.definitions.interactions.CustomId
- Record Components:
runtimeId- the id of theRuntimethis custom id is bound to or the literalindependent.definitionId- theDefinition.definitionId()
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedefinitionIdrecord component.final booleanIndicates whether some other object is "equal to" this one.static CustomIdfromMerged(String customId) Constructs a newCustomIdfrom the given String.final inthashCode()Returns a hash code value for this object.static CustomIdindependent(String definitionId) Constructs a new runtime-independentCustomIdfrom the given definition id.booleanisBound()Checks if the passed custom id is runtime-bound.booleanChecks if the passed custom id is runtime-independent.static booleanChecks if the passed custom id doesn't conform to the defined format of jda-commands.merged()The String representation of this custom id.Gets the runtime id of this custom id.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
BOUND_CUSTOM_ID_REGEX
- See Also:
-
INDEPENDENT_CUSTOM_ID_REGEX
-
-
Constructor Details
-
CustomId
Creates an instance of aCustomIdrecord class.- Parameters:
runtimeId- the value for theruntimeIdrecord componentdefinitionId- the value for thedefinitionIdrecord component
-
-
Method Details
-
fromMerged
-
independent
-
isInvalid
Checks if the passed custom id doesn't conform to the defined format of jda-commands.- Returns:
trueif the passed custom id doesn't conform to the jda-commands format
-
merged
The String representation of this custom id. -
runtimeId
Gets the runtime id of this custom id.- Returns:
- the runtime id
- Throws:
IllegalStateException- if this custom id is runtime-independent
-
isIndependent
public boolean isIndependent()Checks if the passed custom id is runtime-independent.- Returns:
trueif the custom id is runtime-independent
-
isBound
public boolean isBound()Checks if the passed custom id is runtime-bound.- Returns:
trueif the custom id is runtime-bound
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
definitionId
Returns the value of thedefinitionIdrecord component.- Returns:
- the value of the
definitionIdrecord component
-