Package com.io7m.brooklime.api
Class BLProgressUpdate
java.lang.Object
com.io7m.brooklime.api.BLProgressUpdate
- All Implemented Interfaces:
BLProgressEventType,BLProgressEventType.BLProgressUpdateType
public final class BLProgressUpdate
extends Object
implements BLProgressEventType.BLProgressUpdateType
Progress was made on a particular file.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.io7m.brooklime.api.BLProgressEventType
BLProgressEventType.BLProgressFileStartedType, BLProgressEventType.BLProgressUpdateType, BLProgressEventType.Kind -
Method Summary
Modifier and TypeMethodDescriptionintintstatic BLProgressUpdate.Builderbuilder()Creates a builder forBLProgressUpdate.longlonglongstatic BLProgressUpdateCreates an immutable copy of aBLProgressEventType.BLProgressUpdateTypevalue.booleanThis instance is equal to all instances ofBLProgressUpdatethat have equal attribute values.intintinthashCode()Computes a hash code from attributes:name,fileIndexCurrent,fileIndexMaximum,attemptCurrent,attemptMaximum,bytesSent,bytesMaximum,progress,bytesPerSecond,timeRemaining.name()doubleprogress()toString()Prints the immutable valueBLProgressUpdatewith attribute values.final BLProgressUpdatewithAttemptCurrent(int value) Copy the current immutable object by setting a value for theattemptCurrentattribute.final BLProgressUpdatewithAttemptMaximum(int value) Copy the current immutable object by setting a value for theattemptMaximumattribute.final BLProgressUpdatewithBytesMaximum(long value) Copy the current immutable object by setting a value for thebytesMaximumattribute.final BLProgressUpdatewithBytesPerSecond(long value) Copy the current immutable object by setting a value for thebytesPerSecondattribute.final BLProgressUpdatewithBytesSent(long value) Copy the current immutable object by setting a value for thebytesSentattribute.final BLProgressUpdatewithFileIndexCurrent(int value) Copy the current immutable object by setting a value for thefileIndexCurrentattribute.final BLProgressUpdatewithFileIndexMaximum(int value) Copy the current immutable object by setting a value for thefileIndexMaximumattribute.final BLProgressUpdateCopy the current immutable object by setting a value for thenameattribute.final BLProgressUpdatewithProgress(double value) Copy the current immutable object by setting a value for theprogressattribute.final BLProgressUpdatewithTimeRemaining(Duration value) Copy the current immutable object by setting a value for thetimeRemainingattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.brooklime.api.BLProgressEventType.BLProgressUpdateType
kind
-
Method Details
-
name
- Specified by:
namein interfaceBLProgressEventType- Specified by:
namein interfaceBLProgressEventType.BLProgressUpdateType- Returns:
- The value of the
nameattribute
-
fileIndexCurrent
public int fileIndexCurrent()- Specified by:
fileIndexCurrentin interfaceBLProgressEventType- Specified by:
fileIndexCurrentin interfaceBLProgressEventType.BLProgressUpdateType- Returns:
- The value of the
fileIndexCurrentattribute
-
fileIndexMaximum
public int fileIndexMaximum()- Specified by:
fileIndexMaximumin interfaceBLProgressEventType- Specified by:
fileIndexMaximumin interfaceBLProgressEventType.BLProgressUpdateType- Returns:
- The value of the
fileIndexMaximumattribute
-
attemptCurrent
public int attemptCurrent()- Specified by:
attemptCurrentin interfaceBLProgressEventType- Specified by:
attemptCurrentin interfaceBLProgressEventType.BLProgressUpdateType- Returns:
- The value of the
attemptCurrentattribute
-
attemptMaximum
public int attemptMaximum()- Specified by:
attemptMaximumin interfaceBLProgressEventType- Specified by:
attemptMaximumin interfaceBLProgressEventType.BLProgressUpdateType- Returns:
- The value of the
attemptMaximumattribute
-
bytesSent
public long bytesSent()- Specified by:
bytesSentin interfaceBLProgressEventType.BLProgressUpdateType- Returns:
- The number of bytes sent so far
-
bytesMaximum
public long bytesMaximum()- Specified by:
bytesMaximumin interfaceBLProgressEventType.BLProgressUpdateType- Returns:
- The number of bytes that will be sent
-
progress
public double progress()- Specified by:
progressin interfaceBLProgressEventType.BLProgressUpdateType- Returns:
- The progress as a real value
-
bytesPerSecond
public long bytesPerSecond()- Specified by:
bytesPerSecondin interfaceBLProgressEventType.BLProgressUpdateType- Returns:
- The number of bytes per second
-
timeRemaining
- Specified by:
timeRemainingin interfaceBLProgressEventType.BLProgressUpdateType- Returns:
- An estimate of the remaining time
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withFileIndexCurrent
Copy the current immutable object by setting a value for thefileIndexCurrentattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for fileIndexCurrent- Returns:
- A modified copy of the
thisobject
-
withFileIndexMaximum
Copy the current immutable object by setting a value for thefileIndexMaximumattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for fileIndexMaximum- Returns:
- A modified copy of the
thisobject
-
withAttemptCurrent
Copy the current immutable object by setting a value for theattemptCurrentattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for attemptCurrent- Returns:
- A modified copy of the
thisobject
-
withAttemptMaximum
Copy the current immutable object by setting a value for theattemptMaximumattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for attemptMaximum- Returns:
- A modified copy of the
thisobject
-
withBytesSent
Copy the current immutable object by setting a value for thebytesSentattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for bytesSent- Returns:
- A modified copy of the
thisobject
-
withBytesMaximum
Copy the current immutable object by setting a value for thebytesMaximumattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for bytesMaximum- Returns:
- A modified copy of the
thisobject
-
withProgress
Copy the current immutable object by setting a value for theprogressattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for progress- Returns:
- A modified copy of the
thisobject
-
withBytesPerSecond
Copy the current immutable object by setting a value for thebytesPerSecondattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for bytesPerSecond- Returns:
- A modified copy of the
thisobject
-
withTimeRemaining
Copy the current immutable object by setting a value for thetimeRemainingattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for timeRemaining- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofBLProgressUpdatethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:name,fileIndexCurrent,fileIndexMaximum,attemptCurrent,attemptMaximum,bytesSent,bytesMaximum,progress,bytesPerSecond,timeRemaining. -
toString
Prints the immutable valueBLProgressUpdatewith attribute values. -
copyOf
Creates an immutable copy of aBLProgressEventType.BLProgressUpdateTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable BLProgressUpdate instance
-
builder
Creates a builder forBLProgressUpdate.BLProgressUpdate.builder() .setName(String) // requiredname.setFileIndexCurrent(int) // requiredfileIndexCurrent.setFileIndexMaximum(int) // requiredfileIndexMaximum.setAttemptCurrent(int) // requiredattemptCurrent.setAttemptMaximum(int) // requiredattemptMaximum.setBytesSent(long) // requiredbytesSent.setBytesMaximum(long) // requiredbytesMaximum.setProgress(double) // requiredprogress.setBytesPerSecond(long) // requiredbytesPerSecond.setTimeRemaining(java.time.Duration) // requiredtimeRemaining.build();- Returns:
- A new BLProgressUpdate builder
-