Record Class BatchProcessor.BatchProgress
java.lang.Object
java.lang.Record
cloud.opencode.base.parallel.batch.BatchProcessor.BatchProgress
- Enclosing class:
BatchProcessor
public static record BatchProcessor.BatchProgress(int completedBatches, int totalBatches, int lastBatchSize)
extends Record
Batch progress information.
批处理进度信息。
- Since:
- JDK 25, opencode-base-parallel V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionBatchProgress(int completedBatches, int totalBatches, int lastBatchSize) Creates an instance of aBatchProgressrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecompletedBatchesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanChecks if processing is complete.intReturns the value of thelastBatchSizerecord component.intGets the progress percentage.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalBatchesrecord component.
-
Constructor Details
-
BatchProgress
public BatchProgress(int completedBatches, int totalBatches, int lastBatchSize) Creates an instance of aBatchProgressrecord class.- Parameters:
completedBatches- the value for thecompletedBatchesrecord componenttotalBatches- the value for thetotalBatchesrecord componentlastBatchSize- the value for thelastBatchSizerecord component
-
-
Method Details
-
percentage
public int percentage()Gets the progress percentage. 获取进度百分比。- Returns:
- the percentage (0-100) - 百分比
-
isComplete
public boolean isComplete()Checks if processing is complete. 检查处理是否完成。- Returns:
- true if complete - 如果完成返回 true
-
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. -
completedBatches
public int completedBatches()Returns the value of thecompletedBatchesrecord component.- Returns:
- the value of the
completedBatchesrecord component
-
totalBatches
public int totalBatches()Returns the value of thetotalBatchesrecord component.- Returns:
- the value of the
totalBatchesrecord component
-
lastBatchSize
public int lastBatchSize()Returns the value of thelastBatchSizerecord component.- Returns:
- the value of the
lastBatchSizerecord component
-