Record Class ThreadSafetyChecker.CheckResult

java.lang.Object
java.lang.Record
cloud.opencode.base.test.concurrent.ThreadSafetyChecker.CheckResult
Record Components:
passed - whether check passed | 检查是否通过
expected - expected value | 期望值
actual - actual value | 实际值
difference - difference | 差异
Enclosing class:
ThreadSafetyChecker

public static record ThreadSafetyChecker.CheckResult(boolean passed, int expected, int actual, int difference) extends Record
Check result 检查结果
Since:
JDK 25, opencode-base-test V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Summary

    Constructors
    Constructor
    Description
    CheckResult(boolean passed, int expected, int actual, int difference)
    Creates an instance of a CheckResult record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
     
    int
    Returns the value of the actual record component.
    int
    Returns the value of the difference record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the expected record component.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the passed record component.
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • CheckResult

      public CheckResult(boolean passed, int expected, int actual, int difference)
      Creates an instance of a CheckResult record class.
      Parameters:
      passed - the value for the passed record component
      expected - the value for the expected record component
      actual - the value for the actual record component
      difference - the value for the difference record component
  • Method Details

    • accuracy

      public double accuracy()
    • 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 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.
    • passed

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

      public int expected()
      Returns the value of the expected record component.
      Returns:
      the value of the expected record component
    • actual

      public int actual()
      Returns the value of the actual record component.
      Returns:
      the value of the actual record component
    • difference

      public int difference()
      Returns the value of the difference record component.
      Returns:
      the value of the difference record component