Record Class STTransferStatistics
java.lang.Object
java.lang.Record
com.io7m.brooklime.vanilla.internal.streamtime.STTransferStatistics
- Record Components:
sizeExpected- The expected sizesizeTransferred- The amount transferred so faroctetsPerSecond- The average octets per second
public record STTransferStatistics(OptionalLong sizeExpected, long sizeTransferred, double octetsPerSecond)
extends Record
A snapshot of a transfer.
-
Constructor Summary
ConstructorsConstructorDescriptionSTTransferStatistics(OptionalLong sizeExpected, long sizeTransferred, double octetsPerSecond) Creates an instance of aSTTransferStatisticsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of theoctetsPerSecondrecord component.percent()Return the normalized completion percentage.Returns the value of thesizeExpectedrecord component.longReturns the value of thesizeTransferredrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
STTransferStatistics
public STTransferStatistics(OptionalLong sizeExpected, long sizeTransferred, double octetsPerSecond) Creates an instance of aSTTransferStatisticsrecord class.- Parameters:
sizeExpected- the value for thesizeExpectedrecord componentsizeTransferred- the value for thesizeTransferredrecord componentoctetsPerSecond- the value for theoctetsPerSecondrecord component
-
-
Method Details
-
percentNormalized
Return the normalized completion percentage.- Returns:
- The completion "percentage" in the range
[0, 1]
-
percent
- Returns:
- The completion percentage in the range
[0, 100]
-
expectedSecondsRemaining
- Returns:
- The number of seconds expected until the transfer is completed
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
sizeExpected
Returns the value of thesizeExpectedrecord component.- Returns:
- the value of the
sizeExpectedrecord component
-
sizeTransferred
public long sizeTransferred()Returns the value of thesizeTransferredrecord component.- Returns:
- the value of the
sizeTransferredrecord component
-
octetsPerSecond
public double octetsPerSecond()Returns the value of theoctetsPerSecondrecord component.- Returns:
- the value of the
octetsPerSecondrecord component
-