Record Class DoublingDecision.Response

java.lang.Object
java.lang.Record
com.fortemate.dicechess.runtime.DoublingDecision.Response
Record Components:
id - the decision id
seat - the responder's seat, exactly White or Black
offeredBy - the seat that made the double offer, exactly White or Black
proposedStake - the proposed stake if accepted
All Implemented Interfaces:
DoublingDecision
Enclosing interface:
DoublingDecision

public static record DoublingDecision.Response(String id, String seat, String offeredBy, long proposedStake) extends Record implements DoublingDecision
A response decision awaiting the responder's choice to accept or decline an offer.
  • Constructor Details

    • Response

      public Response(String id, String seat, String offeredBy, long proposedStake)
      Creates a validated response 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
    • offeredBy

      public String offeredBy()
      Returns the value of the offeredBy record component.
      Returns:
      the value of the offeredBy 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