Package com.io7m.brooklime.api
Class BLProgressUpdate.Builder
- java.lang.Object
-
- com.io7m.brooklime.api.BLProgressUpdate.Builder
-
- Enclosing class:
- BLProgressUpdate
public static final class BLProgressUpdate.Builder extends java.lang.ObjectBuilds instances of typeBLProgressUpdate. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BLProgressUpdatebuild()Builds a newBLProgressUpdate.BLProgressUpdate.Builderfrom(BLProgressEventType instance)Fill a builder with attribute values from the providedcom.io7m.brooklime.api.BLProgressEventTypeinstance.BLProgressUpdate.Builderfrom(BLProgressEventType.BLProgressUpdateType instance)Fill a builder with attribute values from the providedcom.io7m.brooklime.api.BLProgressEventType.BLProgressUpdateTypeinstance.BLProgressUpdate.BuildersetAttemptCurrent(int attemptCurrent)Initializes the value for theattemptCurrentattribute.BLProgressUpdate.BuildersetAttemptMaximum(int attemptMaximum)Initializes the value for theattemptMaximumattribute.BLProgressUpdate.BuildersetBytesMaximum(long bytesMaximum)Initializes the value for thebytesMaximumattribute.BLProgressUpdate.BuildersetBytesPerSecond(long bytesPerSecond)Initializes the value for thebytesPerSecondattribute.BLProgressUpdate.BuildersetBytesSent(long bytesSent)Initializes the value for thebytesSentattribute.BLProgressUpdate.BuildersetFileIndexCurrent(int fileIndexCurrent)Initializes the value for thefileIndexCurrentattribute.BLProgressUpdate.BuildersetFileIndexMaximum(int fileIndexMaximum)Initializes the value for thefileIndexMaximumattribute.BLProgressUpdate.BuildersetName(java.lang.String name)Initializes the value for thenameattribute.BLProgressUpdate.BuildersetProgress(double progress)Initializes the value for theprogressattribute.BLProgressUpdate.BuildersetTimeRemaining(java.time.Duration timeRemaining)Initializes the value for thetimeRemainingattribute.
-
-
-
Method Detail
-
from
public final BLProgressUpdate.Builder from(BLProgressEventType.BLProgressUpdateType instance)
Fill a builder with attribute values from the providedcom.io7m.brooklime.api.BLProgressEventType.BLProgressUpdateTypeinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
public final BLProgressUpdate.Builder from(BLProgressEventType instance)
Fill a builder with attribute values from the providedcom.io7m.brooklime.api.BLProgressEventTypeinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
setName
public final BLProgressUpdate.Builder setName(java.lang.String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
setFileIndexCurrent
public final BLProgressUpdate.Builder setFileIndexCurrent(int fileIndexCurrent)
Initializes the value for thefileIndexCurrentattribute.- Parameters:
fileIndexCurrent- The value for fileIndexCurrent- Returns:
thisbuilder for use in a chained invocation
-
setFileIndexMaximum
public final BLProgressUpdate.Builder setFileIndexMaximum(int fileIndexMaximum)
Initializes the value for thefileIndexMaximumattribute.- Parameters:
fileIndexMaximum- The value for fileIndexMaximum- Returns:
thisbuilder for use in a chained invocation
-
setAttemptCurrent
public final BLProgressUpdate.Builder setAttemptCurrent(int attemptCurrent)
Initializes the value for theattemptCurrentattribute.- Parameters:
attemptCurrent- The value for attemptCurrent- Returns:
thisbuilder for use in a chained invocation
-
setAttemptMaximum
public final BLProgressUpdate.Builder setAttemptMaximum(int attemptMaximum)
Initializes the value for theattemptMaximumattribute.- Parameters:
attemptMaximum- The value for attemptMaximum- Returns:
thisbuilder for use in a chained invocation
-
setBytesSent
public final BLProgressUpdate.Builder setBytesSent(long bytesSent)
Initializes the value for thebytesSentattribute.- Parameters:
bytesSent- The value for bytesSent- Returns:
thisbuilder for use in a chained invocation
-
setBytesMaximum
public final BLProgressUpdate.Builder setBytesMaximum(long bytesMaximum)
Initializes the value for thebytesMaximumattribute.- Parameters:
bytesMaximum- The value for bytesMaximum- Returns:
thisbuilder for use in a chained invocation
-
setProgress
public final BLProgressUpdate.Builder setProgress(double progress)
Initializes the value for theprogressattribute.- Parameters:
progress- The value for progress- Returns:
thisbuilder for use in a chained invocation
-
setBytesPerSecond
public final BLProgressUpdate.Builder setBytesPerSecond(long bytesPerSecond)
Initializes the value for thebytesPerSecondattribute.- Parameters:
bytesPerSecond- The value for bytesPerSecond- Returns:
thisbuilder for use in a chained invocation
-
setTimeRemaining
public final BLProgressUpdate.Builder setTimeRemaining(java.time.Duration timeRemaining)
Initializes the value for thetimeRemainingattribute.- Parameters:
timeRemaining- The value for timeRemaining- Returns:
thisbuilder for use in a chained invocation
-
build
public BLProgressUpdate build()
Builds a newBLProgressUpdate.- Returns:
- An immutable instance of BLProgressUpdate
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-