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 Directivedirective(String name, String value)Return aDirectivebased on the name and value, if value was quoted then this is also captured.booleanequals(Object obj)StringgetName()Represents the directive name.StringgetOriginalValue()Represents the original directive value and in quotes if it was originally quoted.StringgetValue()Represents directive value, won't be quoted even if the original was.inthashCode()booleanhasName()Return true if the directive name is not null or empty.booleanisQuoted()Returntrueif the original directive value was enclosed in quotes.StringtoString()
-
-
-
Method Detail
-
directive
public static Directive directive(String name, String value)
Return aDirectivebased 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
Directivebased 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()
Returntrueif the original directive value was enclosed in quotes.- Returns:
trueif the original directive value was enclosed in quotes.
-
-