Package javatro.core

Record Class PokerHand

java.lang.Object
java.lang.Record
javatro.core.PokerHand
Record Components:
handType - The classification of the poker hand determining base values and increments

public record PokerHand(PokerHand.HandType handType) extends Record
Represents the evaluated result of a poker hand with tracking for progression levels and usage counts. The hand's value is determined by its type, which includes base chips and multipliers adjusted by level. Play counts are managed externally by JavatroCore.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Enumeration of poker hand types with associated base values and progression parameters.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a PokerHand record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Calculates the total chip value adjusted by the hand's current progression level.
    Gets the display name of the poker hand type.
    int
    Calculates the multiplier value adjusted by the hand's current progression level.
    int
    Retrieves the number of times this hand type has been played.
    Returns the value of the handType record component.
    final int
    Returns a hash code value for this object.
    Increments the play counter for this hand type in the external tracker.
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PokerHand

      public PokerHand(PokerHand.HandType handType)
      Creates an instance of a PokerHand record class.
      Parameters:
      handType - the value for the handType record component
  • Method Details

    • getChips

      public int getChips()
      Calculates the total chip value adjusted by the hand's current progression level. Formula: base_chips + (current_level - 1) * level_increment
      Returns:
      Total chips adjusted for current level
    • getMultiplier

      public int getMultiplier()
      Calculates the multiplier value adjusted by the hand's current progression level. Formula: base_multiplier + (current_level - 1) * multiplier_increment
      Returns:
      Total multiplier adjusted for current level
    • getHandName

      public String getHandName()
      Gets the display name of the poker hand type.
      Returns:
      Formal name of the hand type
    • getPlayCount

      public int getPlayCount()
      Retrieves the number of times this hand type has been played.
      Returns:
      Current play count from external tracking system
    • incrementPlayed

      public PokerHand incrementPlayed()
      Increments the play counter for this hand type in the external tracker. Returns the same instance since state is managed externally.
      Returns:
      Current instance after updating play count
    • toString

      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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • handType

      public PokerHand.HandType handType()
      Returns the value of the handType record component.
      Returns:
      the value of the handType record component