| Modifier and Type | Field and Description |
|---|---|
static String |
NAME
The name of this header.
|
| Constructor and Description |
|---|
ContentLengthHeader()
Constructs a new empty header whose length is set to -1.
|
ContentLengthHeader(long length)
Constructs a new header with the provided content length.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getLength()
Returns the content length, or
-1 if no content length has been
set. |
String |
getName()
Returns the name of the header, as it would canonically appear within an
HTTP message.
|
List<String> |
getValues()
Returns the header as a list of strings.
|
static ContentLengthHeader |
valueOf(Message message)
Constructs a new header, initialized from the specified message.
|
static ContentLengthHeader |
valueOf(String string)
Constructs a new header, initialized from the specified string value.
|
equals, getFirstValue, hashCode, toStringpublic static final String NAME
public ContentLengthHeader()
public ContentLengthHeader(long length)
length - The content length, or -1 if no content length has
been set.public static ContentLengthHeader valueOf(Message message)
message - The message to initialize the header from.public static ContentLengthHeader valueOf(String string)
string - The value to initialize the header from.public long getLength()
-1 if no content length has been
set.-1 if no content length has been
set.public String getName()
Headerpublic List<String> getValues()
HeaderString should
represent the value component of the key-value pair that makes up the
HTTP header - as such, for some Header implementations each
String in this List may contain multiple token-separated values.
The List returned from this method should not be expected to be
mutable. However, some subclasses of Header may choose to
implement it as such.
Copyright © 2025 Open Identity Platform Community. All rights reserved.