Class JOSEObjectType

  • All Implemented Interfaces:
    java.io.Serializable

    @Immutable
    public final class JOSEObjectType
    extends java.lang.Object
    implements java.io.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 Summary

      Constructors 
      Constructor Description
      JOSEObjectType​(java.lang.String type)
      Creates a new JOSE object type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object object)
      Overrides Object.equals().
      java.lang.String getType()
      Gets the JOSE object type.
      int hashCode()
      Overrides Object.hashCode().
      java.lang.String toJSONString()
      Returns the JSON string representation of this JOSE object type.
      java.lang.String toString()
      Returns the string representation of this JOSE object type.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • JOSE

        public static final JOSEObjectType JOSE
        Compact encoded JOSE object type.
      • JOSE_JSON

        public static final JOSEObjectType JOSE_JSON
        JSON-encoded JOSE object type..
      • JWT

        public static final JOSEObjectType JWT
        JSON Web Token (JWT) object type.
    • Constructor Detail

      • JOSEObjectType

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

      • getType

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

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

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

        public java.lang.String toString()
        Returns the string representation of this JOSE object type.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation.
        See Also:
        getType()
      • toJSONString

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