Class Directive


  • public final class Directive
    extends Object
    Represents the name/value pair of a HTTP header directives. If the directive value was enclosed in quotes then this will also be captured, often seen in cookie headers.
    • Method Detail

      • directive

        public static Directive directive​(String name,
                                          String value)
        Return a Directive based on the name and value, if value was quoted then this is also captured.
        Parameters:
        name - the name of the directive.
        value - the value of the directive.
        Returns:
        a Directive based on the name and value, if value was quoted then this is also captured.
      • getName

        public String getName()
        Represents the directive name.
        Returns:
        the directive name.
      • hasName

        public boolean hasName()
        Return true if the directive name is not null or empty.
        Returns:
        true if the directive name is not null or empty.
      • getValue

        public String getValue()
        Represents directive value, won't be quoted even if the original was.
        Returns:
        the directive value, won't be quoted even if the original was.
      • getOriginalValue

        public String getOriginalValue()
        Represents the original directive value and in quotes if it was originally quoted.
        Returns:
        the original directive value and in quotes if it was originally quoted.
      • isQuoted

        public boolean isQuoted()
        Return true if the original directive value was enclosed in quotes.
        Returns:
        true if the original directive value was enclosed in quotes.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object