Class PayloadTransferUpdate
java.lang.Object
com.codename1.nearby.transport.PayloadTransferUpdate
Progress on one payload, delivered to
TransportListener.payloadProgress(Endpoint, PayloadTransferUpdate).
A byte payload typically produces a single update with
PayloadStatus.SUCCESS; a file payload produces a stream of
PayloadStatus.IN_PROGRESS updates and then a terminal one.
-
Constructor Summary
ConstructorsConstructorDescriptionPayloadTransferUpdate(int payloadId, long bytesTransferred, long totalBytes, PayloadStatus status) Ports construct these. -
Method Summary
Modifier and TypeMethodDescriptionlongHow many bytes have moved so far.intThe payload this update is about, matchingPayload.getId().Where the transfer got to.longThe payload size, or-1when the platform did not say.toString()Returns a string representation of the object.
-
Constructor Details
-
PayloadTransferUpdate
public PayloadTransferUpdate(int payloadId, long bytesTransferred, long totalBytes, PayloadStatus status) Ports construct these.
Parameters
payloadId: the payload this is aboutbytesTransferred: bytes moved so fartotalBytes: the payload size, or -1 when unknownstatus: where the transfer got to
-
-
Method Details
-
getPayloadId
public int getPayloadId()The payload this update is about, matchingPayload.getId(). -
getBytesTransferred
public long getBytesTransferred()How many bytes have moved so far. -
getTotalBytes
public long getTotalBytes()The payload size, or-1when the platform did not say. A stream payload legitimately has no total, so guard a progress bar on this being positive. -
getStatus
Where the transfer got to. Never null. -
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-