Class BLProgressUpdate.Builder

java.lang.Object
com.io7m.brooklime.api.BLProgressUpdate.Builder
Enclosing class:
BLProgressUpdate

public static final class BLProgressUpdate.Builder extends Object
Builds instances of type BLProgressUpdate. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      Fill a builder with attribute values from the provided com.io7m.brooklime.api.BLProgressEventType.BLProgressUpdateType instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      public final BLProgressUpdate.Builder from(BLProgressEventType instance)
      Fill a builder with attribute values from the provided com.io7m.brooklime.api.BLProgressEventType instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • setName

      public final BLProgressUpdate.Builder setName(String name)
      Initializes the value for the name attribute.
      Parameters:
      name - The value for name
      Returns:
      this builder for use in a chained invocation
    • setFileIndexCurrent

      public final BLProgressUpdate.Builder setFileIndexCurrent(int fileIndexCurrent)
      Initializes the value for the fileIndexCurrent attribute.
      Parameters:
      fileIndexCurrent - The value for fileIndexCurrent
      Returns:
      this builder for use in a chained invocation
    • setFileIndexMaximum

      public final BLProgressUpdate.Builder setFileIndexMaximum(int fileIndexMaximum)
      Initializes the value for the fileIndexMaximum attribute.
      Parameters:
      fileIndexMaximum - The value for fileIndexMaximum
      Returns:
      this builder for use in a chained invocation
    • setAttemptCurrent

      public final BLProgressUpdate.Builder setAttemptCurrent(int attemptCurrent)
      Initializes the value for the attemptCurrent attribute.
      Parameters:
      attemptCurrent - The value for attemptCurrent
      Returns:
      this builder for use in a chained invocation
    • setAttemptMaximum

      public final BLProgressUpdate.Builder setAttemptMaximum(int attemptMaximum)
      Initializes the value for the attemptMaximum attribute.
      Parameters:
      attemptMaximum - The value for attemptMaximum
      Returns:
      this builder for use in a chained invocation
    • setBytesSent

      public final BLProgressUpdate.Builder setBytesSent(long bytesSent)
      Initializes the value for the bytesSent attribute.
      Parameters:
      bytesSent - The value for bytesSent
      Returns:
      this builder for use in a chained invocation
    • setBytesMaximum

      public final BLProgressUpdate.Builder setBytesMaximum(long bytesMaximum)
      Initializes the value for the bytesMaximum attribute.
      Parameters:
      bytesMaximum - The value for bytesMaximum
      Returns:
      this builder for use in a chained invocation
    • setProgress

      public final BLProgressUpdate.Builder setProgress(double progress)
      Initializes the value for the progress attribute.
      Parameters:
      progress - The value for progress
      Returns:
      this builder for use in a chained invocation
    • setBytesPerSecond

      public final BLProgressUpdate.Builder setBytesPerSecond(long bytesPerSecond)
      Initializes the value for the bytesPerSecond attribute.
      Parameters:
      bytesPerSecond - The value for bytesPerSecond
      Returns:
      this builder for use in a chained invocation
    • setTimeRemaining

      public final BLProgressUpdate.Builder setTimeRemaining(Duration timeRemaining)
      Initializes the value for the timeRemaining attribute.
      Parameters:
      timeRemaining - The value for timeRemaining
      Returns:
      this builder for use in a chained invocation
    • build

      public BLProgressUpdate build()
      Builds a new BLProgressUpdate.
      Returns:
      An immutable instance of BLProgressUpdate
      Throws:
      IllegalStateException - if any required attributes are missing