Record Class Invocation
java.lang.Object
java.lang.Record
dev.sympho.modular_commands.api.command.Invocation
- Record Components:
chain
- The invocation chain, the sequence of keys that forms the invocation.
An invocation of a command. That is, a sequence of keys (names) that (possibly) map
to a command in the system.
- Since:
- 1.0
- Version:
- 1.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInvocation
(List<String> chain) Constructs an invocation determined by the given chain. -
Method Summary
Modifier and TypeMethodDescriptionchain()
Returns the value of thechain
record component.Determines the invocation formed by adding the given command name to this invocation.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.iterator()
static Invocation
Constructs an invocation from the given sequence of command names.static Invocation
Constructs an invocation from the given sequence of command names.parent()
Determines the parent invocation of this chain.stream()
Obtains a stream over the invocation elements.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
EMPTY
The empty invocation.
-
-
Constructor Details
-
Invocation
Constructs an invocation determined by the given chain.- Parameters:
chain
- The invocation chain.
-
-
Method Details
-
child
Determines the invocation formed by adding the given command name to this invocation.- Parameters:
command
- The child command to invoke.- Returns:
- The invocation of the child command.
-
parent
Determines the parent invocation of this chain.- Returns:
- The invocation of the parent command.
-
of
Constructs an invocation from the given sequence of command names.- Parameters:
commands
- The command names.- Returns:
- The constructed invocation.
-
of
Constructs an invocation from the given sequence of command names.- Parameters:
commands
- The command names.- Returns:
- The constructed invocation.
-
iterator
-
spliterator
- Specified by:
spliterator
in interfaceIterable<String>
-
stream
Obtains a stream over the invocation elements.- Returns:
- The stream.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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)
. -
chain
Returns the value of thechain
record component.- Returns:
- the value of the
chain
record component
-