Record Class LevelRule.Static
java.lang.Object
java.lang.Record
de.Keyle.MyPet.api.skill.skilltree.levelrule.LevelRule.Static
- Record Components:
levels- the levels this rule matches
- All Implemented Interfaces:
LevelRule
- Enclosing interface:
LevelRule
Matches an explicit, fixed set of levels.
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.Keyle.MyPet.api.skill.skilltree.levelrule.LevelRule
LevelRule.Dynamic, LevelRule.Static -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheck(int level) Tests whether this rule matches the given level.final booleanIndicates whether some other object is "equal to" this one.intReturns the priority used to order this rule relative to other rules that match the same level.final inthashCode()Returns a hash code value for this object.levels()Returns the value of thelevelsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Static
Defensively copies the level set.
-
-
Method Details
-
check
public boolean check(int level) Description copied from interface:LevelRuleTests whether this rule matches the given level. -
getPriority
public int getPriority()Description copied from interface:LevelRuleReturns the priority used to order this rule relative to other rules that match the same level. Lower values execute first.- Specified by:
getPriorityin interfaceLevelRule- Returns:
- the ordering priority
-
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). -
levels
Returns the value of thelevelsrecord component.- Returns:
- the value of the
levelsrecord component
-