public class ExtendedUUID extends UUID
UUID accommodating additional data such as a flag and a small hashmap. There may be many instances
in memory, and as they are serialized a lot and sent across the wire, I tried to make this as compact as possible.
As a consequence, the hashmap can have a max size of 255 and a value can have a max length of 255 bytes.| Modifier and Type | Field and Description |
|---|---|
static short |
can_become_site_master |
protected short |
flags |
protected byte[][] |
keys |
static short |
site_master |
protected byte[][] |
values |
cache, leastSigBits, mostSigBits, numberGenerator, print_function, print_uuids, SIZE| Modifier | Constructor and Description |
|---|---|
|
ExtendedUUID() |
protected |
ExtendedUUID(byte[] data) |
|
ExtendedUUID(ExtendedUUID other) |
|
ExtendedUUID(long mostSigBits,
long leastSigBits) |
| Modifier and Type | Method and Description |
|---|---|
ExtendedUUID |
addContents(ExtendedUUID other) |
ExtendedUUID |
clearFlag(short flag) |
protected String |
flagsToString() |
byte[] |
get(byte[] key) |
byte[] |
get(String key) |
boolean |
isFlagSet(short flag) |
boolean |
keyExists(byte[] key) |
boolean |
keyExists(String key) |
int |
length()
The number of non-null keys
|
String |
print() |
ExtendedUUID |
put(byte[] key,
byte[] val) |
protected ExtendedUUID |
put(int start_index,
byte[] key,
byte[] val) |
ExtendedUUID |
put(String key,
byte[] val) |
static ExtendedUUID |
randomUUID() |
static ExtendedUUID |
randomUUID(String name) |
protected void |
read(DataInput in) |
void |
readExternal(ObjectInput in) |
void |
readFrom(DataInput in)
Read the state of the current object (including superclasses) from instream
Note that the input stream must not be closed
|
byte[] |
remove(byte[] key) |
byte[] |
remove(String key) |
protected void |
resize(int new_length) |
ExtendedUUID |
setFlag(short flag) |
int |
size()
The number of bytes required to serialize this instance
|
protected int |
sizeofHashMap() |
String |
toString() |
protected void |
write(DataOutput out) |
void |
writeExternal(ObjectOutput out) |
void |
writeTo(DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
|
add, add, compareTo, copy, digits, equals, fromString, generateRandomBytes, get, getByName, getContents, getLeastSignificantBits, getMostSignificantBits, hashCode, printCache, remove, removeAll, retainAll, toStringLongprotected short flags
protected byte[][] keys
protected byte[][] values
public static final short site_master
public static final short can_become_site_master
public ExtendedUUID()
protected ExtendedUUID(byte[] data)
public ExtendedUUID(long mostSigBits,
long leastSigBits)
public ExtendedUUID(ExtendedUUID other)
public static ExtendedUUID randomUUID()
public static ExtendedUUID randomUUID(String name)
public ExtendedUUID setFlag(short flag)
public ExtendedUUID clearFlag(short flag)
public boolean isFlagSet(short flag)
public byte[] get(byte[] key)
public byte[] get(String key)
public ExtendedUUID put(byte[] key, byte[] val)
protected ExtendedUUID put(int start_index, byte[] key, byte[] val)
public ExtendedUUID put(String key, byte[] val)
public byte[] remove(byte[] key)
public byte[] remove(String key)
public boolean keyExists(byte[] key)
public boolean keyExists(String key)
public ExtendedUUID addContents(ExtendedUUID other)
public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizablewriteExternal in class UUIDIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizablereadExternal in class UUIDIOExceptionClassNotFoundExceptionpublic void writeTo(DataOutput out) throws Exception
StreamablewriteTo in interface StreamablewriteTo in class UUIDExceptionpublic void readFrom(DataInput in) throws Exception
StreamablereadFrom in interface StreamablereadFrom in class UUIDExceptionpublic int size()
public int length()
public String print()
protected void write(DataOutput out) throws IOException
IOExceptionprotected void read(DataInput in) throws IOException
IOExceptionprotected int sizeofHashMap()
protected void resize(int new_length)
protected String flagsToString()
Copyright © 2025 JBoss, a division of Red Hat. All rights reserved.