Class JOSEObjectType

  • All Implemented Interfaces:
    Serializable

    @Immutable
    public final class JOSEObjectType
    extends Object
    implements Serializable
    JOSE object type, represents the typ header parameter in unsecured, JSON Web Signature (JWS) and JSON Web Encryption (JWE) objects. This class is immutable.

    Includes constants for the following standard types:

    Additional types can be defined using the constructor.

    Version:
    2021-04-06
    Author:
    Vladimir Dzhuvinov
    See Also:
    Serialized Form
    • Constructor Detail

      • JOSEObjectType

        public JOSEObjectType​(String type)
        Creates a new JOSE object type.
        Parameters:
        type - The object type. Must not be null.
    • Method Detail

      • getType

        public String getType()
        Gets the JOSE object type.
        Returns:
        The JOSE object type.
      • hashCode

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

        public 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 JOSE object type.
        Overrides:
        toString in class Object
        Returns:
        The string representation.
        See Also:
        getType()
      • toJSONString

        public String toJSONString()
        Returns the JSON string representation of this JOSE object type.
        Returns:
        The JSON string representation.