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 ofUUIDaccommodating 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 intflags-
Fields inherited from class org.jgroups.util.UUID
leastSigBits, mostSigBits, SIZE
-
Fields inherited from interface org.jgroups.Address
IP_ADDR, IP_ADDR_UUID, NULL, SITE_MASTER, SITE_UUID, UUID_ADDR
-
-
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 interfacebooleanisFlagSet(short flag)static FlagsUUIDrandomUUID()static FlagsUUIDrandomUUID(java.lang.String name)voidreadFrom(java.io.DataInput in)Read the state of the current object (including superclasses) from instream Note that the input stream must not be closedintserializedSize()The number of bytes required to serialize this instance<T extends FlagsUUID>
TsetFlag(short flag)java.lang.StringtoString()voidwriteTo(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, toStringLong
-
-
-
-
Method Detail
-
create
public java.util.function.Supplier<? extends UUID> create()
Description copied from interface:ConstructableCreates an instance of the class implementing this interface- Specified by:
createin interfaceConstructable<UUID>- Overrides:
createin 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.IOExceptionDescription copied from interface:StreamableWrite the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed- Specified by:
writeToin interfaceStreamable- Overrides:
writeToin classUUID- Throws:
java.io.IOException
-
readFrom
public void readFrom(java.io.DataInput in) throws java.io.IOExceptionDescription copied from interface:StreamableRead the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Specified by:
readFromin interfaceStreamable- Overrides:
readFromin classUUID- Throws:
java.io.IOException
-
serializedSize
public int serializedSize()
The number of bytes required to serialize this instance- Specified by:
serializedSizein interfaceSizeStreamable- Overrides:
serializedSizein classUUID
-
-