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 Summary
ConstructorsConstructorDescriptionBufferStatus(long currentValue, long maxValue, int usagePercent, boolean nextBufferReady) Creates an instance of aBufferStatusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecurrentValuerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longmaxValue()Returns the value of themaxValuerecord component.booleanReturns the value of thenextBufferReadyrecord component.toString()Returns a string representation of this record class.intReturns the value of theusagePercentrecord component.
-
Constructor Details
-
BufferStatus
public BufferStatus(long currentValue, long maxValue, int usagePercent, boolean nextBufferReady) Creates an instance of aBufferStatusrecord class.- Parameters:
currentValue- the value for thecurrentValuerecord componentmaxValue- the value for themaxValuerecord componentusagePercent- the value for theusagePercentrecord componentnextBufferReady- the value for thenextBufferReadyrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
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 thecomparemethod from their corresponding wrapper classes. -
currentValue
public long currentValue()Returns the value of thecurrentValuerecord component.- Returns:
- the value of the
currentValuerecord component
-
maxValue
-
usagePercent
public int usagePercent()Returns the value of theusagePercentrecord component.- Returns:
- the value of the
usagePercentrecord component
-
nextBufferReady
public boolean nextBufferReady()Returns the value of thenextBufferReadyrecord component.- Returns:
- the value of the
nextBufferReadyrecord component
-