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 ofBLProgressEventType.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
All Methods Static Methods Instance Methods Concrete Methods 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, wait
-
Methods inherited from interface com.io7m.brooklime.api.BLProgressEventType.BLProgressUpdateType
kind
-
-
-
-
Method Detail
-
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
public final BLProgressUpdate withName(java.lang.String value)
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
public final BLProgressUpdate withFileIndexCurrent(int value)
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
public final BLProgressUpdate withFileIndexMaximum(int value)
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
public final BLProgressUpdate withAttemptCurrent(int value)
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
public final BLProgressUpdate withAttemptMaximum(int value)
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
public final BLProgressUpdate withBytesSent(long value)
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
public final BLProgressUpdate withBytesMaximum(long value)
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
public final BLProgressUpdate withProgress(double value)
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
public final BLProgressUpdate withBytesPerSecond(long value)
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
public final BLProgressUpdate withTimeRemaining(java.time.Duration value)
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
public static BLProgressUpdate copyOf(BLProgressEventType.BLProgressUpdateType instance)
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
public static BLProgressUpdate.Builder 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
-
-