Record Class CommandParameterInfo<T>
java.lang.Object
java.lang.Record
nl.pim16aap2.animatedarchitecture.spigot.core.comands.CommandParameterInfo<T>
- Type Parameters:
T- the type of the parameter.- Record Components:
name- the name of the parameter.clz- the class of the parameter.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CommandParameterInfo<Integer> static final CommandParameterInfo<String> static final CommandParameterInfo<MovementDirection> static final CommandParameterInfo<Boolean> static final CommandParameterInfo<Boolean> static final CommandParameterInfo<String> static final CommandParameterInfo<org.bukkit.entity.Player> static final CommandParameterInfo<PermissionLevel> static final CommandParameterInfo<Boolean> static final CommandParameterInfo<String> static final CommandParameterInfo<String> static final CommandParameterInfo<String> static final CommandParameterInfo<StructureRetriever> static final CommandParameterInfo<StructureType> static final CommandParameterInfo<org.bukkit.entity.Player> -
Constructor Summary
ConstructorsConstructorDescriptionCommandParameterInfo(String name, Class<T> clz) Creates an instance of aCommandParameterInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionclz()Returns the value of theclzrecord component.final booleanIndicates whether some other object is "equal to" this one.get(cloud.commandframework.context.CommandContext<ICommandSender> context) Gets the parameter from the context.@Nullable TgetNullable(cloud.commandframework.context.CommandContext<ICommandSender> context) Gets the parameter from the context, or null if not present.getOrDefault(cloud.commandframework.context.CommandContext<ICommandSender> context, T defaultValue) Gets the parameter from the context, or returns the default value if not present.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
PARAM_STRUCTURE_RETRIEVER
-
PARAM_PERMISSION_LEVEL
-
PARAM_TARGET_PLAYER
-
PARAM_NEW_OWNER
-
PARAM_STRUCTURE_NAME
-
PARAM_LOCK_STATUS
-
PARAM_SEND_UPDATED_INFO
-
PARAM_IS_OPEN
-
PARAM_DIRECTION
-
PARAM_STRUCTURE_TYPE
-
PARAM_BLOCKS_TO_MOVE
-
PARAM_NAME
-
PARAM_DATA
-
PARAM_STEP_NAME
-
PARAM_STEP_VALUE
-
-
Constructor Details
-
CommandParameterInfo
-
-
Method Details
-
getNullable
public @Nullable T getNullable(cloud.commandframework.context.CommandContext<ICommandSender> context) Gets the parameter from the context, or null if not present.- Parameters:
context- the command context.- Returns:
- the parameter value, or null if not present.
-
get
Gets the parameter from the context.- Parameters:
context- the command context.- Returns:
- the parameter value.
-
getOrDefault
public T getOrDefault(cloud.commandframework.context.CommandContext<ICommandSender> context, T defaultValue) Gets the parameter from the context, or returns the default value if not present.- Parameters:
context- the command context.defaultValue- the default value to return if the parameter is not present.- Returns:
- the parameter value, or the default value if not present.
-
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). -
name
-
clz
-