public class FlagsUUID extends UUID
UUID
accommodating additional data such as a flag. 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.Modifier and Type | Field and Description |
---|---|
protected int |
flags |
leastSigBits, mostSigBits, numberGenerator, SIZE
IP_ADDR, IP_ADDR_UUID, NULL, SITE_MASTER, SITE_UUID, UUID_ADDR
Modifier | Constructor and Description |
---|---|
|
FlagsUUID() |
protected |
FlagsUUID(byte[] data) |
|
FlagsUUID(long mostSigBits,
long leastSigBits) |
|
FlagsUUID(T other) |
Modifier and Type | Method and Description |
---|---|
<T extends FlagsUUID> |
addContents(T other) |
<T extends FlagsUUID> |
clearFlag(short flag) |
Supplier<? extends UUID> |
create()
Creates an instance of the class implementing this interface
|
boolean |
isFlagSet(short flag) |
static FlagsUUID |
randomUUID() |
static FlagsUUID |
randomUUID(String name) |
void |
readFrom(DataInput in)
Read the state of the current object (including superclasses) from instream
Note that the input stream must not be closed
|
int |
serializedSize()
The number of bytes required to serialize this instance
|
<T extends FlagsUUID> |
setFlag(short flag) |
String |
toString() |
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 FlagsUUID()
protected FlagsUUID(byte[] data)
public FlagsUUID(long mostSigBits, long leastSigBits)
public FlagsUUID(T other)
public Supplier<? extends UUID> create()
Constructable
create
in interface Constructable<UUID>
create
in class UUID
public static FlagsUUID randomUUID()
public <T extends FlagsUUID> T setFlag(short flag)
public <T extends FlagsUUID> T clearFlag(short flag)
public boolean isFlagSet(short flag)
public <T extends FlagsUUID> T addContents(T other)
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 serializedSize()
serializedSize
in interface SizeStreamable
serializedSize
in class UUID
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.