Class BaseIdentifier

    • Constructor Detail

      • BaseIdentifier

        public BaseIdentifier()
        Creates a new unique identifier (ID) based on a secure randomly generated 256-bit number, Base64URL-encoded.
      • BaseIdentifier

        public BaseIdentifier​(int byteLength)
        Creates a new unique identifier (ID) based on a secure randomly generated number with the specified byte length, Base64URL-encoded.
      • BaseIdentifier

        public BaseIdentifier​(String value)
        Creates a new identifier (ID) from the specified string. The value is not validated (for legality or uniqueness) in any way.
        Parameters:
        value - The identifier (ID) value. Must not be null.
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides Object.hashCode().
        Overrides:
        hashCode in class Object
        Returns:
        The object hash code.
      • equals

        public abstract boolean equals​(Object object)
        Overrides Object.equals().
        Overrides:
        equals in class Object
        Parameters:
        object - The object to compare to.
        Returns:
        true if the objects have the same value, otherwise false.
      • toString

        public String toString()
        Returns the string representation of this identifier (ID).
        Overrides:
        toString in class Object
        Returns:
        The string representation.
      • toJSONString

        public String toJSONString()
        Returns the JSON string representation of this identifier (ID).
        Specified by:
        toJSONString in interface net.minidev.json.JSONAware
        Returns:
        The JSON string representation.