Record Class SegmentIdGenerator.BufferStatus

java.lang.Object
java.lang.Record
cloud.opencode.base.id.segment.SegmentIdGenerator.BufferStatus
Record Components:
currentValue - the current value | 当前值
maxValue - the max value | 最大值
usagePercent - the usage percentage | 使用百分比
nextBufferReady - whether next buffer is ready | 下一缓冲区是否就绪
Enclosing class:
SegmentIdGenerator

public static record SegmentIdGenerator.BufferStatus(long currentValue, long maxValue, int usagePercent, boolean nextBufferReady) extends Record
Buffer Status 缓冲区状态
Since:
JDK 25, opencode-base-id V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • BufferStatus

      public BufferStatus(long currentValue, long maxValue, int usagePercent, boolean nextBufferReady)
      Creates an instance of a BufferStatus record class.
      Parameters:
      currentValue - the value for the currentValue record component
      maxValue - the value for the maxValue record component
      usagePercent - the value for the usagePercent record component
      nextBufferReady - the value for the nextBufferReady record component
  • Method Details

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

      public long currentValue()
      Returns the value of the currentValue record component.
      Returns:
      the value of the currentValue record component
    • maxValue

      public long maxValue()
      Returns the value of the maxValue record component.
      Returns:
      the value of the maxValue record component
    • usagePercent

      public int usagePercent()
      Returns the value of the usagePercent record component.
      Returns:
      the value of the usagePercent record component
    • nextBufferReady

      public boolean nextBufferReady()
      Returns the value of the nextBufferReady record component.
      Returns:
      the value of the nextBufferReady record component