Class StringId

  • All Implemented Interfaces:
    Id, java.io.Serializable, java.lang.Comparable<StringId>
    Direct Known Subclasses:
    HierarchicalName

    public class StringId
    extends java.lang.Object
    implements Id, java.lang.Comparable<StringId>

    A simple String-based id.

    An instance of StringId can be used in several threads concurrently.

    Author:
    agz
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      StringId​(java.lang.String id)
      Creates a new String-based id.
    • Constructor Detail

      • StringId

        public StringId​(java.lang.String id)
        Creates a new String-based id.

        The specified id must not be null.

        Parameters:
        id - String-content, the new id is based on
    • Method Detail

      • getString

        public final java.lang.String getString()
        Description copied from interface: Id
        Returns the string-representation of this Id.
        Specified by:
        getString in interface Id
        Returns:
        the string-representation of this Id
      • equals

        public final boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compareTo

        public final int compareTo​(StringId id)
        Specified by:
        compareTo in interface java.lang.Comparable<StringId>
      • toString

        public final java.lang.String toString()
        This toString()-method returns a full representation of a StringId which is compatible with the constructor. So this toString()-method is usable in business-logic and not only for debugging purposes.
        Overrides:
        toString in class java.lang.Object