public class HandleValue
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<HandleValue> |
INDEX_COMPARATOR |
static int |
MAX_RECOGNIZED_TTL |
static byte |
SUBTYPE_SEPARATOR |
static byte |
TTL_TYPE_ABSOLUTE |
static byte |
TTL_TYPE_RELATIVE |
Constructor and Description |
---|
HandleValue() |
HandleValue(int index,
byte[] type,
byte[] data) |
HandleValue(int index,
byte[] type,
byte[] data,
byte ttlType,
int ttl,
int timestamp,
ValueReference[] references,
boolean adminRead,
boolean adminWrite,
boolean publicRead,
boolean publicWrite) |
HandleValue(int index,
java.lang.String type,
byte[] data) |
HandleValue(int index,
java.lang.String type,
java.lang.String data) |
Modifier and Type | Method and Description |
---|---|
HandleValue |
duplicate()
Returns a copy of this HandleValue
|
boolean |
equals(java.lang.Object obj) |
boolean |
equalsIgnoreTimestamp(HandleValue other) |
boolean |
getAdminCanRead() |
boolean |
getAdminCanWrite() |
boolean |
getAnyoneCanRead() |
boolean |
getAnyoneCanWrite() |
byte[] |
getData() |
java.lang.String |
getDataAsString() |
int |
getIndex() |
java.lang.String |
getNicerTimestampAsString() |
java.lang.String |
getPermissionString() |
ValueReference[] |
getReferences() |
int |
getTimestamp() |
java.util.Date |
getTimestampAsDate() |
java.lang.String |
getTimestampAsString() |
int |
getTTL() |
byte |
getTTLType() |
byte[] |
getType() |
java.lang.String |
getTypeAsString() |
int |
hashCode() |
boolean |
hasType(byte[] someType)
Returns whether or not this handle value has the given type.
|
boolean |
isExpired(int now,
int timeRetrieved)
Given the current time and the time this value was retrieved from a
handle server (in seconds), return true if this value is "stale" and
should be retrieved again.
|
void |
setAdminCanRead(boolean newAdminRead) |
void |
setAdminCanWrite(boolean newAdminWrite) |
void |
setAnyoneCanRead(boolean newPublicRead) |
void |
setAnyoneCanWrite(boolean newPublicWrite) |
void |
setData(byte[] newData) |
void |
setIndex(int newIndex) |
void |
setReferences(ValueReference[] newReferences) |
void |
setTimestamp(int newTimestamp) |
void |
setTTL(int newTTL) |
void |
setTTLType(byte newTTLType) |
void |
setType(byte[] newType) |
java.lang.String |
toDetailedString() |
java.lang.String |
toString() |
static boolean |
unorderedEquals(HandleValue[] vals1,
HandleValue[] vals2) |
static boolean |
unorderedEqualsIgnoreTimestamp(HandleValue[] vals1,
HandleValue[] vals2) |
public static final byte SUBTYPE_SEPARATOR
public static final byte TTL_TYPE_RELATIVE
public static final byte TTL_TYPE_ABSOLUTE
public static final int MAX_RECOGNIZED_TTL
public static java.util.Comparator<HandleValue> INDEX_COMPARATOR
public HandleValue()
public HandleValue(int index, byte[] type, byte[] data)
public HandleValue(int index, java.lang.String type, byte[] data)
public HandleValue(int index, java.lang.String type, java.lang.String data)
public HandleValue(int index, byte[] type, byte[] data, byte ttlType, int ttl, int timestamp, ValueReference[] references, boolean adminRead, boolean adminWrite, boolean publicRead, boolean publicWrite)
public final java.lang.String getPermissionString()
public java.lang.String toDetailedString()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isExpired(int now, int timeRetrieved)
public final boolean hasType(byte[] someType)
public final java.lang.String getDataAsString()
public final java.lang.String getTypeAsString()
public final java.lang.String getTimestampAsString()
public final java.lang.String getNicerTimestampAsString()
public final java.util.Date getTimestampAsDate()
public final int getIndex()
public final void setIndex(int newIndex)
public final byte[] getType()
public final void setType(byte[] newType)
public final byte[] getData()
public final void setData(byte[] newData)
public final byte getTTLType()
public final void setTTLType(byte newTTLType)
public final int getTTL()
public final void setTTL(int newTTL)
public final int getTimestamp()
public final void setTimestamp(int newTimestamp)
public final ValueReference[] getReferences()
public final void setReferences(ValueReference[] newReferences)
public final boolean getAdminCanRead()
public final void setAdminCanRead(boolean newAdminRead)
public final boolean getAdminCanWrite()
public final void setAdminCanWrite(boolean newAdminWrite)
public final boolean getAnyoneCanRead()
public final void setAnyoneCanRead(boolean newPublicRead)
public final boolean getAnyoneCanWrite()
public final void setAnyoneCanWrite(boolean newPublicWrite)
public HandleValue duplicate()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean equalsIgnoreTimestamp(HandleValue other)
public static boolean unorderedEquals(HandleValue[] vals1, HandleValue[] vals2)
public static boolean unorderedEqualsIgnoreTimestamp(HandleValue[] vals1, HandleValue[] vals2)