public final class QueueId extends U32Id implements Comparable<QueueId>
All constructors for this class are private.
Creating instances of QueueId is done via the static
methods on the class.
Instances of this class are immutable, making them inherently threadsafe.
This class overrides UnsignedLongBasedId.equals(java.lang.Object) and UnsignedLongBasedId.hashCode() so that
instances play nicely with the Collection classes.
This class implements the Comparable interface to ensure that
a sorted list of queue IDs is presented in an intuitive order.
| Modifier and Type | Field and Description |
|---|---|
static QueueId |
ALL
Wildcard queue used for queue stats requests; Since 1.0.
|
E_BYTES_BAD_LEN, LENGTH_IN_BYTES, MAX_VALUEidE_BAD, E_NULL_BYTES, E_NULL_STR, E_OOR, MIN_VALUE| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(QueueId o)
Implements the Comparable interface, to return queue ids in
natural order.
|
String |
toString()
Returns a string representation of the queue id.
|
static QueueId |
valueOf(byte[] bytes)
Returns an object that represents the queue identifier
defined by the specified byte array.
|
static QueueId |
valueOf(long qid)
Returns an object that represents the queue id
defined by the specified long.
|
static QueueId |
valueOf(String qidStr)
Returns an object that represents the queue id
defined by the specified string.
|
rangeCheck, toByteArrayequals, hashCode, toLongparseIntStr, parseLongStrgetRefQ, keyFromBytespublic static final QueueId ALL
public String toString()
toString in class UnsignedLongBasedIdpublic int compareTo(QueueId o)
compareTo in interface Comparable<QueueId>o - the other queue idComparable.compareTo(T)public static QueueId valueOf(long qid)
qid - the queue idIllegalArgumentException - if the queue id is invalidpublic static QueueId valueOf(String qidStr)
qidStr - the queue id as a stringIllegalArgumentException - if the string is invalidNullPointerException - if the string is nullpublic static QueueId valueOf(byte[] bytes)
U32Id.LENGTH_IN_BYTES bytes long.bytes - the encoded idNullPointerException - if the byte array is nullIllegalArgumentException - if the byte array is not 4 bytes longCopyright © 2014. All Rights Reserved.