Class ComponentIdentifier

java.lang.Object
com.authlete.hms.ComponentIdentifier

public class ComponentIdentifier extends Object
A class representing a component identifier.

RFC 9421 HTTP Message Signatures, Section 1.1. Conventions and Terminology, explains HTTP Message Component Identifier as follows:

The combination of an HTTP message component name and any parameters. This combination uniquely identifies a specific HTTP message component with respect to a particular HTTP message signature and the HTTP message it applies to.

See Also:
  • Constructor Details

    • ComponentIdentifier

      public ComponentIdentifier(String componentName)
      A constructor with a component name.
      Parameters:
      componentName - A component name.
      Throws:
      IllegalArgumentException - The component name is null.
    • ComponentIdentifier

      public ComponentIdentifier(String componentName, ComponentIdentifierParameters parameters)
      A constructor with a component name and parameters.
      Parameters:
      componentName - A component name.
      parameters - Parameters.
      Throws:
      IllegalArgumentException - The component name is null.
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Get the string representation of this instance, which is the serialized component identifier returned by the serialize() method.
      Overrides:
      toString in class Object
      Returns:
      The string representation of this instance.
    • serialize

      public String serialize()
      Serialize the component identifier represented by this instance, and return the resulting string.
      Returns:
      The serialized component identifier represented by this instance.
    • serializeTo

      public StringBuilder serializeTo(StringBuilder sb)
      Serialize the component identifier represented by this instance, and write the resulting string into the specified string builder.
      Parameters:
      sb - A string builder into which the resulting string is written.
      Returns:
      The same string builder that was passed as the argument.
    • getComponentName

      public String getComponentName()
      Get the component name.
      Returns:
      The component name.
    • getParameters

      public ComponentIdentifierParameters getParameters()
      Get the parameters which are part of this component identifier.
      Returns:
      The parameters.
    • isDerivedComponent

      public boolean isDerivedComponent()
      Get the flag indicating that the component name of this component identifier refers to a derived component.
      Returns:
      True if the component name refers to a derived component. In other words, true if the component name starts with "@".