public class ExtendedUUID extends FlagsUUID
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 |
---|---|
protected byte[][] |
keys |
protected byte[][] |
values |
leastSigBits, mostSigBits, numberGenerator, SIZE
IP_ADDR, IP_ADDR_UUID, NULL, SITE_MASTER, SITE_UUID, UUID_ADDR
Modifier | Constructor and Description |
---|---|
|
ExtendedUUID() |
protected |
ExtendedUUID(byte[] data) |
|
ExtendedUUID(long mostSigBits,
long leastSigBits) |
|
ExtendedUUID(T o) |
Modifier and Type | Method and Description |
---|---|
<T extends FlagsUUID> |
addContents(T o) |
Supplier<? extends UUID> |
create()
Creates an instance of the class implementing this interface
|
byte[] |
get(byte[] key) |
byte[] |
get(String key) |
boolean |
keyExists(byte[] key) |
boolean |
keyExists(String key) |
int |
length()
The number of non-null keys
|
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 |
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) |
int |
serializedSize()
The number of bytes required to serialize this instance
|
protected int |
sizeofHashMap() |
String |
toString() |
protected void |
write(DataOutput out) |
void |
writeTo(DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
|
compareTo, copy, digits, equals, fromString, generateRandomBytes, generateRandomBytes, getLeastSignificantBits, getMostSignificantBits, hashCode, toStringLong
public ExtendedUUID()
protected ExtendedUUID(byte[] data)
public ExtendedUUID(long mostSigBits, long leastSigBits)
public ExtendedUUID(T o)
public Supplier<? extends UUID> create()
Constructable
create
in interface Constructable<UUID>
create
in class FlagsUUID
public static ExtendedUUID randomUUID()
public static ExtendedUUID randomUUID(String name)
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 <T extends FlagsUUID> T addContents(T o)
addContents
in class FlagsUUID
public void writeTo(DataOutput out) throws Exception
Streamable
writeTo
in interface Streamable
writeTo
in class FlagsUUID
Exception
public void readFrom(DataInput in) throws Exception
Streamable
readFrom
in interface Streamable
readFrom
in class FlagsUUID
Exception
public int serializedSize()
serializedSize
in interface SizeStreamable
serializedSize
in class FlagsUUID
public int length()
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)
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.