Record Class CloneContext.CloneStatistics

java.lang.Object
java.lang.Record
cloud.opencode.base.deepclone.CloneContext.CloneStatistics
Record Components:
objectsCloned - number of objects cloned | 克隆的对象数
objectsSkipped - number of objects skipped (immutable) | 跳过的对象数(不可变)
maxDepthReached - maximum depth reached | 达到的最大深度
elapsedNanos - elapsed time in nanoseconds | 经过的纳秒时间
Enclosing class:
CloneContext

public static record CloneContext.CloneStatistics(int objectsCloned, int objectsSkipped, int maxDepthReached, long elapsedNanos) extends Record
Clone statistics record 克隆统计信息记录
Since:
JDK 25, opencode-base-deepclone V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • CloneStatistics

      public CloneStatistics(int objectsCloned, int objectsSkipped, int maxDepthReached, long elapsedNanos)
      Creates an instance of a CloneStatistics record class.
      Parameters:
      objectsCloned - the value for the objectsCloned record component
      objectsSkipped - the value for the objectsSkipped record component
      maxDepthReached - the value for the maxDepthReached record component
      elapsedNanos - the value for the elapsedNanos record component
  • Method Details

    • elapsedMillis

      public double elapsedMillis()
      Gets elapsed time in milliseconds 获取经过的毫秒时间
      Returns:
      elapsed milliseconds | 经过的毫秒
    • 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. 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.
    • objectsCloned

      public int objectsCloned()
      Returns the value of the objectsCloned record component.
      Returns:
      the value of the objectsCloned record component
    • objectsSkipped

      public int objectsSkipped()
      Returns the value of the objectsSkipped record component.
      Returns:
      the value of the objectsSkipped record component
    • maxDepthReached

      public int maxDepthReached()
      Returns the value of the maxDepthReached record component.
      Returns:
      the value of the maxDepthReached record component
    • elapsedNanos

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