Record Class RangeArgumentRequirementFactory.RangeImpl
java.lang.Object
java.lang.Record
net.apartium.cocoabeans.commands.requirements.argument.RangeArgumentRequirementFactory.RangeImpl
- All Implemented Interfaces:
ArgumentRequirement
- Enclosing class:
RangeArgumentRequirementFactory
public static record RangeArgumentRequirementFactory.RangeImpl(double from, double to, double step)
extends Record
implements ArgumentRequirement
-
Constructor Summary
ConstructorsConstructorDescriptionRangeImpl(double from, double to, double step) Creates an instance of aRangeImplrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.doublefrom()Returns the value of thefromrecord component.final inthashCode()Returns a hash code value for this object.booleanmeetsRequirement(@NotNull Sender sender, @Nullable CommandContext context, @Nullable Object argument) doublestep()Returns the value of thesteprecord component.doubleto()Returns the value of thetorecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RangeImpl
public RangeImpl(double from, double to, double step) Creates an instance of aRangeImplrecord class.- Parameters:
from- the value for thefromrecord componentto- the value for thetorecord componentstep- the value for thesteprecord component
-
-
Method Details
-
meetsRequirement
public boolean meetsRequirement(@NotNull @NotNull Sender sender, @Nullable @Nullable CommandContext context, @Nullable @Nullable Object argument) - Specified by:
meetsRequirementin interfaceArgumentRequirement
-
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 with '=='. -
from
public double from()Returns the value of thefromrecord component.- Returns:
- the value of the
fromrecord component
-
to
public double to()Returns the value of thetorecord component.- Returns:
- the value of the
torecord component
-
step
public double step()Returns the value of thesteprecord component.- Returns:
- the value of the
steprecord component
-