Class NamedUuid


  • public final class NamedUuid
    extends java.lang.Object
    This king of uuid contains a hash code for some string in his internal structure.
    Author:
    javaito
    • Method Summary

      Modifier and Type Method Description
      static NamedUuid create​(java.lang.String name)
      Creates an instance of named uuid from a name.
      static NamedUuid create​(java.util.UUID uuid)
      Creates an instance of named uuid from a uuid instance.
      java.lang.Integer getHash()
      Returns the hash code of the creation name.
      java.util.UUID getId()
      Returns the uuid instance.
      static java.lang.String getName​(java.util.UUID uuid)
      Returns the name registered for the hash stored into the uuid instance.
      static void registerName​(java.lang.String name)
      Register the hash code for the specific name.
      java.lang.String toString()
      Returns the string representation of internal id.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • registerName

        public static void registerName​(java.lang.String name)
        Register the hash code for the specific name.
        Parameters:
        name - Specific name.
      • getName

        public static java.lang.String getName​(java.util.UUID uuid)
        Returns the name registered for the hash stored into the uuid instance.
        Parameters:
        uuid - Uuid instance.
        Returns:
        Registered name.
        Throws:
        java.lang.IllegalArgumentException - id the uuid instance is not a uuid version 5.
      • getId

        public java.util.UUID getId()
        Returns the uuid instance.
        Returns:
        UUID instance.
      • getHash

        public java.lang.Integer getHash()
        Returns the hash code of the creation name.
        Returns:
        Hash code of the name.
      • create

        public static NamedUuid create​(java.util.UUID uuid)
        Creates an instance of named uuid from a uuid instance.
        Parameters:
        uuid - UUID instance.
        Returns:
        Named uuid instance.
      • create

        public static NamedUuid create​(java.lang.String name)
        Creates an instance of named uuid from a name.
        Parameters:
        name - Name
        Returns:
        Named uuid instance.
      • toString

        public java.lang.String toString()
        Returns the string representation of internal id.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String representation of the internal id.