Record Class ChoiceConstraint
java.lang.Object
java.lang.Record
org.magic.api.ast.abilities.ChoiceConstraint
-
Constructor Summary
ConstructorsConstructorDescriptionChoiceConstraint(int minimum, int maximum, boolean sameModeAllowed) Creates an instance of aChoiceConstraintrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmaximum()Returns the value of themaximumrecord component.intminimum()Returns the value of theminimumrecord component.booleanReturns the value of thesameModeAllowedrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ChoiceConstraint
public ChoiceConstraint(int minimum, int maximum, boolean sameModeAllowed) Creates an instance of aChoiceConstraintrecord class.- Parameters:
minimum- the value for theminimumrecord componentmaximum- the value for themaximumrecord componentsameModeAllowed- the value for thesameModeAllowedrecord component
-
-
Method Details
-
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 with thecomparemethod from their corresponding wrapper classes. -
minimum
public int minimum()Returns the value of theminimumrecord component.- Returns:
- the value of the
minimumrecord component
-
maximum
public int maximum()Returns the value of themaximumrecord component.- Returns:
- the value of the
maximumrecord component
-
sameModeAllowed
public boolean sameModeAllowed()Returns the value of thesameModeAllowedrecord component.- Returns:
- the value of the
sameModeAllowedrecord component
-