Class FlagsUUID

java.lang.Object
org.jgroups.util.UUID
org.jgroups.util.FlagsUUID
All Implemented Interfaces:
Comparable<Address>, Address, Constructable<UUID>, SizeStreamable, Streamable
Direct Known Subclasses:
ExtendedUUID

public class FlagsUUID extends UUID
Subclass of 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.
Since:
3.5
  • Field Details

    • flags

      protected int flags
  • Constructor Details

    • FlagsUUID

      public FlagsUUID()
    • FlagsUUID

      protected FlagsUUID(byte[] data)
    • FlagsUUID

      public FlagsUUID(long mostSigBits, long leastSigBits)
    • FlagsUUID

      public FlagsUUID(T other)
  • Method Details

    • create

      public Supplier<? extends UUID> create()
      Description copied from interface: Constructable
      Creates an instance of the class implementing this interface
      Specified by:
      create in interface Constructable<UUID>
      Overrides:
      create in class UUID
    • randomUUID

      public static FlagsUUID randomUUID()
    • randomUUID

      public static FlagsUUID randomUUID(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(DataOutput out) throws 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 interface Streamable
      Overrides:
      writeTo in class UUID
      Throws:
      IOException
    • readFrom

      public void readFrom(DataInput in) throws 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 interface Streamable
      Overrides:
      readFrom in class UUID
      Throws:
      IOException
    • serializedSize

      public int serializedSize()
      The number of bytes required to serialize this instance
      Specified by:
      serializedSize in interface SizeStreamable
      Overrides:
      serializedSize in class UUID
    • toString

      public String toString()
      Overrides:
      toString in class UUID