Record Class RankDisplay

java.lang.Object
java.lang.Record
mekhq.gui.displayWrappers.RankDisplay
Record Components:
rankNumeric - region Variable Declarations

public record RankDisplay(int rankNumeric, String displayName) extends Record
  • Constructor Details

    • RankDisplay

      public RankDisplay(int rankNumeric, String displayName)
      Creates an instance of a RankDisplay record class.
      Parameters:
      rankNumeric - the value for the rankNumeric record component
      displayName - the value for the displayName record 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 from
      initialProfession - the initial profession for the ranks
      Returns:
      a list of all valid rank displays
    • toString

      @Nonnull public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • rankNumeric

      public int rankNumeric()
      Returns the value of the rankNumeric record component.
      Returns:
      the value of the rankNumeric record component
    • displayName

      public String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component