Package org.forgerock.http.header
Class Directive
- java.lang.Object
-
- org.forgerock.http.header.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Directive
directive(String name, String value)
Return aDirective
based on the name and value, if value was quoted then this is also captured.boolean
equals(Object obj)
String
getName()
Represents the directive name.String
getOriginalValue()
Represents the original directive value and in quotes if it was originally quoted.String
getValue()
Represents directive value, won't be quoted even if the original was.int
hashCode()
boolean
hasName()
Return true if the directive name is not null or empty.boolean
isQuoted()
Returntrue
if the original directive value was enclosed in quotes.String
toString()
-
-
-
Method Detail
-
directive
public static Directive directive(String name, String value)
Return aDirective
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()
Returntrue
if the original directive value was enclosed in quotes.- Returns:
true
if the original directive value was enclosed in quotes.
-
-