Class SiteUUID

All Implemented Interfaces:
Comparable<Address>, Address, Constructable<UUID>, SiteAddress, SizeStreamable, Streamable
Direct Known Subclasses:
SiteMaster

public class SiteUUID extends ExtendedUUID implements SiteAddress
Implementation of SiteAddress
Since:
3.2
  • Field Details

  • Constructor Details

  • Method Details

    • getName

      public String getName()
    • getSite

      public String getSite()
      Description copied from interface: SiteAddress
      Returns the ID of the site (all sites need to have a unique site ID)
      Specified by:
      getSite in interface SiteAddress
    • 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 ExtendedUUID
    • copy

      public UUID copy()
      Overrides:
      copy in class UUID
    • toString

      public String toString()
      Overrides:
      toString in class ExtendedUUID
    • hashCode

      public int hashCode()
      Description copied from class: UUID
      Returns a hash code for this UUID.
      Overrides:
      hashCode in class UUID
      Returns:
      A hash code value for this UUID
    • equals

      public boolean equals(Object obj)
      Description copied from class: UUID
      Compares this object to the specified object. The result is true if and only if the argument is not null, is a UUID object, and contains the same most- and least significant bits.
      Overrides:
      equals in class UUID
      Parameters:
      obj - The object to be compared
      Returns:
      true if the objects are the same; false otherwise
    • compareTo

      public int compareTo(Address other)
      Description copied from class: UUID
      Compares this UUID with the specified UUID.

      The first of two UUIDs is greater than the second if the most significant field in which the UUIDs differ is greater for the first UUID.

      Specified by:
      compareTo in interface Comparable<Address>
      Overrides:
      compareTo in class UUID
      Parameters:
      other - UUID to which this UUID is to be compared
      Returns:
      -1, 0 or 1 as this UUID is less than, equal to, or greater than val
    • isSiteAddress

      public boolean isSiteAddress()
      Description copied from interface: Address
      Whether or not this address is a SiteAddress. Kludgey workaround to avoid the use of instanceof SiteAddress.

      Will be removed once the type pollution issue (https://bugs.openjdk.org/browse/JDK-8180450) is fixed.

      Specified by:
      isSiteAddress in interface Address
      Returns:
      True if this address is a site address, otherwise false
    • print

      public String print(boolean detailed)
    • serializedSize

      public int serializedSize()
      Description copied from class: ExtendedUUID
      The number of bytes required to serialize this instance
      Specified by:
      serializedSize in interface SizeStreamable
      Overrides:
      serializedSize in class ExtendedUUID
    • 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 ExtendedUUID
      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 ExtendedUUID
      Throws:
      IOException
    • printOthers

      protected String printOthers()