Package org.glassfish.grizzly.http.util
Class HeaderValue
- java.lang.Object
-
- org.glassfish.grizzly.http.util.HeaderValue
-
public final class HeaderValue extends Object
This class serves as an HTTP header value holder, plus it implements useful utility methods to optimize headers serialization.- Author:
- Alexey Stashok
-
-
Field Summary
Fields Modifier and Type Field Description static HeaderValueIDENTITY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringget()byte[]getByteArray()booleanisSet()static HeaderValuenewHeaderValue(String value)Creates aHeaderValuewrapper over aStringheader value representation.HeaderValueprepare()Prepare the HeaderValue for the serialization.voidserializeToDataChunk(DataChunk dc)Serializes this HeaderValue value into a passedDataChunk.StringtoString()
-
-
-
Field Detail
-
IDENTITY
public static final HeaderValue IDENTITY
-
-
Method Detail
-
newHeaderValue
public static HeaderValue newHeaderValue(String value)
Creates aHeaderValuewrapper over aStringheader value representation.- Parameters:
value-Stringheader value representation- Returns:
- a
HeaderValuewrapper over aStringheade value representation
-
prepare
public HeaderValue prepare()
Prepare the HeaderValue for the serialization. This method might be particularly useful if we use the same HeaderValue over and over for different responses, so that the HeaderValue will not have to be parsed and prepared for each response separately.- Returns:
- this HeaderValue
-
isSet
public boolean isSet()
- Returns:
- true if header value is not null, or false otherwise
-
get
public String get()
- Returns:
- the header value string
-
getByteArray
public byte[] getByteArray()
- Returns:
- the byte array representation of the header value
-
-