Package org.jgroups.util
Class FlagsUUID
- java.lang.Object
-
- org.jgroups.util.UUID
-
- org.jgroups.util.FlagsUUID
-
- All Implemented Interfaces:
java.lang.Comparable<Address>
,Address
,Constructable<UUID>
,SizeStreamable
,Streamable
- Direct Known Subclasses:
ExtendedUUID
public class FlagsUUID extends UUID
Subclass ofUUID
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.- Since:
- 3.5
- Author:
- Bela Ban
-
-
Field Summary
Fields Modifier and Type Field Description protected int
flags
-
Fields inherited from class org.jgroups.util.UUID
leastSigBits, mostSigBits, SIZE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends FlagsUUID>
TaddContents(T other)
<T extends FlagsUUID>
TclearFlag(short flag)
java.util.function.Supplier<? extends UUID>
create()
Creates an instance of the class implementing this interfaceboolean
isFlagSet(short flag)
static FlagsUUID
randomUUID()
static FlagsUUID
randomUUID(java.lang.String name)
void
readFrom(java.io.DataInput in)
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closedint
serializedSize()
The number of bytes required to serialize this instance<T extends FlagsUUID>
TsetFlag(short flag)
java.lang.String
toString()
void
writeTo(java.io.DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.-
Methods inherited from class org.jgroups.util.UUID
compareTo, copy, digits, equals, fromString, generateRandomBytes, getLeastSignificantBits, getMostSignificantBits, hashCode, printName, toStringLong
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jgroups.Address
isMulticast, isSiteAddress, isSiteMaster
-
-
-
-
Method Detail
-
create
public java.util.function.Supplier<? extends UUID> create()
Description copied from interface:Constructable
Creates an instance of the class implementing this interface- Specified by:
create
in interfaceConstructable<UUID>
- Overrides:
create
in classUUID
-
randomUUID
public static FlagsUUID randomUUID()
-
randomUUID
public static FlagsUUID randomUUID(java.lang.String name)
-
setFlag
public <T extends FlagsUUID> T setFlag(short flag)
-
clearFlag
public <T extends FlagsUUID> T clearFlag(short flag)
-
isFlagSet
public boolean isFlagSet(short flag)
-
addContents
public <T extends FlagsUUID> T addContents(T other)
-
writeTo
public void writeTo(java.io.DataOutput out) throws java.io.IOException
Description copied from interface:Streamable
Write the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed- Specified by:
writeTo
in interfaceStreamable
- Overrides:
writeTo
in classUUID
- Throws:
java.io.IOException
-
readFrom
public void readFrom(java.io.DataInput in) throws java.io.IOException
Description copied from interface:Streamable
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Specified by:
readFrom
in interfaceStreamable
- Overrides:
readFrom
in classUUID
- Throws:
java.io.IOException
-
serializedSize
public int serializedSize()
The number of bytes required to serialize this instance- Specified by:
serializedSize
in interfaceSizeStreamable
- Overrides:
serializedSize
in classUUID
-
-