Record Class Content.ChallengeResult

java.lang.Object
java.lang.Record
ai.badmonkey.agentspaces.content.Content.ChallengeResult
Record Components:
holder - the challenged member
root - the root it claims to hold
picks - the picks named
proven - the picks whose bytes arrived and verified by CID
passed - whether every pick verified within the deadline
reason - why the challenge failed, or null when it passed
elapsed - milliseconds from the send to the outcome
Enclosing class:
Content

public static record Content.ChallengeResult(PeerId holder, String root, int picks, int proven, boolean passed, String reason, long elapsed) extends Record
The outcome of one possession challenge (PDT 2 phase 3, P2-S-07).
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChallengeResult(PeerId holder, String root, int picks, int proven, boolean passed, String reason, long elapsed)
    Creates an instance of a ChallengeResult record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the value of the elapsed record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the holder record component.
    boolean
    Returns the value of the passed record component.
    int
    Returns the value of the picks record component.
    int
    Returns the value of the proven record component.
    Returns the value of the reason record component.
    Returns the value of the root record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • ChallengeResult

      public ChallengeResult(PeerId holder, String root, int picks, int proven, boolean passed, String reason, long elapsed)
      Creates an instance of a ChallengeResult record class.
      Parameters:
      holder - the value for the holder record component
      root - the value for the root record component
      picks - the value for the picks record component
      proven - the value for the proven record component
      passed - the value for the passed record component
      reason - the value for the reason record component
      elapsed - the value for the elapsed record component
  • Method Details

    • 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.
    • holder

      public PeerId holder()
      Returns the value of the holder record component.
      Returns:
      the value of the holder record component
    • root

      public String root()
      Returns the value of the root record component.
      Returns:
      the value of the root record component
    • picks

      public int picks()
      Returns the value of the picks record component.
      Returns:
      the value of the picks record component
    • proven

      public int proven()
      Returns the value of the proven record component.
      Returns:
      the value of the proven record component
    • passed

      public boolean passed()
      Returns the value of the passed record component.
      Returns:
      the value of the passed record component
    • reason

      public String reason()
      Returns the value of the reason record component.
      Returns:
      the value of the reason record component
    • elapsed

      public long elapsed()
      Returns the value of the elapsed record component.
      Returns:
      the value of the elapsed record component