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 java.lang.Object implements BLProgressEventType.BLProgressUpdateType
Immutable implementation of
BLProgressEventType.BLProgressUpdateType.
Use the builder to create immutable instances:
BLProgressUpdate.builder().
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBLProgressUpdate.BuilderBuilds instances of typeBLProgressUpdate.Nested classes/interfaces inherited from interface com.io7m.brooklime.api.BLProgressEventType
BLProgressEventType.BLProgressFileStartedType, BLProgressEventType.BLProgressUpdateType, BLProgressEventType.Kind -
Method Summary
Modifier and Type Method Description intattemptCurrent()intattemptMaximum()static BLProgressUpdate.Builderbuilder()Creates a builder forBLProgressUpdate.longbytesMaximum()longbytesPerSecond()longbytesSent()static BLProgressUpdatecopyOf(BLProgressEventType.BLProgressUpdateType instance)Creates an immutable copy of aBLProgressEventType.BLProgressUpdateTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofBLProgressUpdatethat have equal attribute values.intfileIndexCurrent()intfileIndexMaximum()inthashCode()Computes a hash code from attributes:name,fileIndexCurrent,fileIndexMaximum,attemptCurrent,attemptMaximum,bytesSent,bytesMaximum,progress,bytesPerSecond,timeRemaining.java.lang.Stringname()doubleprogress()java.time.DurationtimeRemaining()java.lang.StringtoString()Prints the immutable valueBLProgressUpdatewith attribute values.BLProgressUpdatewithAttemptCurrent(int value)Copy the current immutable object by setting a value for theattemptCurrentattribute.BLProgressUpdatewithAttemptMaximum(int value)Copy the current immutable object by setting a value for theattemptMaximumattribute.BLProgressUpdatewithBytesMaximum(long value)Copy the current immutable object by setting a value for thebytesMaximumattribute.BLProgressUpdatewithBytesPerSecond(long value)Copy the current immutable object by setting a value for thebytesPerSecondattribute.BLProgressUpdatewithBytesSent(long value)Copy the current immutable object by setting a value for thebytesSentattribute.BLProgressUpdatewithFileIndexCurrent(int value)Copy the current immutable object by setting a value for thefileIndexCurrentattribute.BLProgressUpdatewithFileIndexMaximum(int value)Copy the current immutable object by setting a value for thefileIndexMaximumattribute.BLProgressUpdatewithName(java.lang.String value)Copy the current immutable object by setting a value for thenameattribute.BLProgressUpdatewithProgress(double value)Copy the current immutable object by setting a value for theprogressattribute.BLProgressUpdatewithTimeRemaining(java.time.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
public java.lang.String 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 value of the
bytesSentattribute
-
bytesMaximum
public long bytesMaximum()- Specified by:
bytesMaximumin interfaceBLProgressEventType.BLProgressUpdateType- Returns:
- The value of the
bytesMaximumattribute
-
progress
public double progress()- Specified by:
progressin interfaceBLProgressEventType.BLProgressUpdateType- Returns:
- The value of the
progressattribute
-
bytesPerSecond
public long bytesPerSecond()- Specified by:
bytesPerSecondin interfaceBLProgressEventType.BLProgressUpdateType- Returns:
- The value of the
bytesPerSecondattribute
-
timeRemaining
public java.time.Duration timeRemaining()- Specified by:
timeRemainingin interfaceBLProgressEventType.BLProgressUpdateType- Returns:
- The value of the
timeRemainingattribute
-
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
public boolean equals(java.lang.Object another)This instance is equal to all instances ofBLProgressUpdatethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:name,fileIndexCurrent,fileIndexMaximum,attemptCurrent,attemptMaximum,bytesSent,bytesMaximum,progress,bytesPerSecond,timeRemaining.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueBLProgressUpdatewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
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
-