Package mekhq.gui.displayWrappers
Record Class RankDisplay
java.lang.Object
java.lang.Record
mekhq.gui.displayWrappers.RankDisplay
- Record Components:
rankNumeric- region Variable Declarations
-
Constructor Summary
ConstructorsConstructorDescriptionRankDisplay(int rankNumeric, String displayName) Creates an instance of aRankDisplayrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedisplayNamerecord component.final booleanIndicates whether some other object is "equal to" this one.static List<RankDisplay> getRankDisplaysForSystem(RankSystem rankSystem, Profession initialProfession) This creates a list of all valid rank displays, which can then be added to a checkbox or used to create menu itemsfinal inthashCode()Returns a hash code value for this object.intReturns the value of therankNumericrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
RankDisplay
Creates an instance of aRankDisplayrecord class.- Parameters:
rankNumeric- the value for therankNumericrecord componentdisplayName- the value for thedisplayNamerecord component
-
-
Method Details
-
getRankDisplaysForSystem
public static List<RankDisplay> getRankDisplaysForSystem(RankSystem rankSystem, Profession initialProfession) This creates a list of all valid rank displays, which can then be added to a checkbox or used to create menu items- Parameters:
rankSystem- the rank system to get all valid rank display frominitialProfession- the initial profession for the ranks- Returns:
- a list of all valid rank displays
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
rankNumeric
public int rankNumeric()Returns the value of therankNumericrecord component.- Returns:
- the value of the
rankNumericrecord component
-
displayName
Returns the value of thedisplayNamerecord component.- Returns:
- the value of the
displayNamerecord component
-