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

    Constructors
    Constructor
    Description
    BatchProgress(int completedBatches, int totalBatches, int lastBatchSize)
    Creates an instance of a BatchProgress record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the completedBatches record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Checks if processing is complete.
    int
    Returns the value of the lastBatchSize record component.
    int
    Gets the progress percentage.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the totalBatches record component.

    Methods inherited from class Object

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

    • BatchProgress

      public BatchProgress(int completedBatches, int totalBatches, int lastBatchSize)
      Creates an instance of a BatchProgress record class.
      Parameters:
      completedBatches - the value for the completedBatches record component
      totalBatches - the value for the totalBatches record component
      lastBatchSize - the value for the lastBatchSize record 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

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

      public int completedBatches()
      Returns the value of the completedBatches record component.
      Returns:
      the value of the completedBatches record component
    • totalBatches

      public int totalBatches()
      Returns the value of the totalBatches record component.
      Returns:
      the value of the totalBatches record component
    • lastBatchSize

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