public class ParameterizedHeader extends Object
A utility class to parse headers that are of the format param1, param2=value, param3="quoted string"
such as Cache-Control etc.
ParameterizedHeaderWithValue
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static ParameterizedHeader |
fromString(String input)
Converts a comma-separated list of param names (with optional values) into a Parameterized Header
|
int |
hashCode() |
boolean |
hasParameter(String name) |
String |
parameter(String name) |
String |
parameter(String name,
String defaultValue) |
List<String> |
parameterNames() |
Map<String,String> |
parameters() |
String |
toString()
Converts the HeaderValue into a string, suitable for printing in an HTTP header.
|
public String parameter(String name)
name
- The name of the parameter to getpublic String parameter(String name, String defaultValue)
name
- The name of the parameter to getdefaultValue
- The value to return if no parameter was setpublic boolean hasParameter(String name)
name
- The name of the parameter to look uppublic List<String> parameterNames()
public static ParameterizedHeader fromString(String input)
Converts a comma-separated list of param names (with optional values) into a Parameterized Header
Null or blank strings return value with an empty parameter map.
input
- The value to parseIllegalArgumentException
- The value cannot be parsedpublic String toString()
Copyright © 2017–2019. All rights reserved.