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, toStringLong
protected 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 Externalizable
writeExternal
in class UUID
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class UUID
IOException
ClassNotFoundException
public void writeTo(DataOutput out) throws Exception
Streamable
writeTo
in interface Streamable
writeTo
in class UUID
Exception
public void readFrom(DataInput in) throws Exception
Streamable
readFrom
in interface Streamable
readFrom
in class UUID
Exception
public int size()
public int length()
public String print()
protected void write(DataOutput out) throws IOException
IOException
protected void read(DataInput in) throws IOException
IOException
protected int sizeofHashMap()
protected void resize(int new_length)
protected String flagsToString()
Copyright © 2023 JBoss, a division of Red Hat. All rights reserved.