Class JOSEObjectType

java.lang.Object
com.nimbusds.jose.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:
2024-04-20
Author:
Vladimir Dzhuvinov
See Also:
  • Field Details

  • Constructor Details

    • JOSEObjectType

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

    • 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:
    • toJSONString

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