Record Class DoublingDecision.Offer

java.lang.Object
java.lang.Record
com.fortemate.dicechess.runtime.DoublingDecision.Offer
Record Components:
id - the decision id
seat - the turn owner's seat, exactly White or Black
proposedStake - the proposed stake if doubled
All Implemented Interfaces:
DoublingDecision
Enclosing interface:
DoublingDecision

public static record DoublingDecision.Offer(String id, String seat, long proposedStake) extends Record implements DoublingDecision
An offer decision awaiting the turn owner's choice to offer a double or roll.
  • Constructor Details

    • Offer

      public Offer(String id, String seat, long proposedStake)
      Creates a validated offer decision.
  • Method Details

    • kind

      public String kind()
      Description copied from interface: DoublingDecision
      Returns the decision kind, exactly offer or response.
      Specified by:
      kind in interface DoublingDecision
      Returns:
      the decision kind
    • toString

      public final 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 the compare method from their corresponding wrapper classes.
      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.
    • id

      public String id()
      Returns the value of the id record component.
      Specified by:
      id in interface DoublingDecision
      Returns:
      the value of the id record component
    • seat

      public String seat()
      Returns the value of the seat record component.
      Specified by:
      seat in interface DoublingDecision
      Returns:
      the value of the seat record component
    • proposedStake

      public long proposedStake()
      Returns the value of the proposedStake record component.
      Specified by:
      proposedStake in interface DoublingDecision
      Returns:
      the value of the proposedStake record component