Class CompressionAlgorithm

java.lang.Object
com.nimbusds.jose.CompressionAlgorithm
All Implemented Interfaces:
Serializable

@Immutable public final class CompressionAlgorithm extends Object implements Serializable
Compression algorithm name, represents the zip header parameter in JSON Web Encryption (JWE) objects. This class is immutable.

Includes a constant for the standard DEFLATE compression algorithm:

Additional compression algorithm names can be defined using the constructor.

Version:
2024-04-20
Author:
Vladimir Dzhuvinov
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    DEFLATE Compressed Data Format Specification version 1.3, as described in RFC 1951.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new compression algorithm with the specified name.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object object)
    Overrides Object.equals().
    Gets the name of this compression algorithm.
    int
    Overrides Object.hashCode().
    Returns the JSON string representation of this compression algorithm.
    Returns the string representation of this compression algorithm.

    Methods inherited from class java.lang.Object

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

    • DEF

      public static final CompressionAlgorithm DEF
      DEFLATE Compressed Data Format Specification version 1.3, as described in RFC 1951.
  • Constructor Details

    • CompressionAlgorithm

      Creates a new compression algorithm with the specified name.
      Parameters:
      name - The compression algorithm name. Must not be null.
  • Method Details

    • getName

      public String getName()
      Gets the name of this compression algorithm.
      Returns:
      The compression algorithm name.
    • 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 compression algorithm.
      Overrides:
      toString in class Object
      Returns:
      The string representation.
      See Also:
    • toJSONString

      public String toJSONString()
      Returns the JSON string representation of this compression algorithm.
      Returns:
      The JSON string representation.