Package org.apache.juneau.http.header
Class BasicCsvHeader
java.lang.Object
org.apache.juneau.http.header.BasicHeader
org.apache.juneau.http.header.BasicCsvHeader
- All Implemented Interfaces:
- Serializable,- Cloneable,- Header,- NameValuePair
- Direct Known Subclasses:
- Allow,- ContentLanguage,- Thrown,- Upgrade,- Via
Category of headers that consist of a comma-delimited list of string values.
 
Example
Allow: GET, PUT
See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionBasicCsvHeader(String name, String value) Constructor.BasicCsvHeader(String name, String... value) Constructor.BasicCsvHeader(String name, Supplier<String[]> value) Constructor with delayed value.
- 
Method SummaryModifier and TypeMethodDescriptionasArray()Returns the header value as an array wrapped in anOptional.asList()Returns the header value as a list wrapped in anOptional.Provides the ability to perform fluent-style assertions on this header.booleanReturnstrue if this header contains the specified value.booleancontainsIgnoreCase(String val) Returnstrue if this header contains the specified value usingString.equalsIgnoreCase(String).getValue()static BasicCsvHeaderStatic creator.static BasicCsvHeaderStatic creator.static BasicCsvHeaderStatic creator with delayed value.String[]Return the value if present, otherwise returnother .String[]toArray()Returns the header value as an array.toList()Returns the header value as a list.Methods inherited from class org.apache.juneau.http.header.BasicHeaderassertName, assertStringValue, asString, equals, equalsIgnoreCase, get, getElements, getName, hashCode, isNotEmpty, isPresent, of, of, orElse, toString
- 
Constructor Details- 
BasicCsvHeaderConstructor.- Parameters:
- name- The header name.
- value- The header value.
 Must be a comma-delimited list.
 Can be- null .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
BasicCsvHeaderConstructor.- Parameters:
- name- The header name.
- value- The header value.
 Can be- null .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
BasicCsvHeaderConstructor with delayed value.Header value is re-evaluated on each call to getValue().- Parameters:
- name- The header name.
- value- The supplier of the header value.
 Can be- null .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
 
- 
- 
Method Details- 
ofStatic creator.- Parameters:
- name- The header name.
- value- The header value.
 Must be a comma-delimited list.
 Can be- null .
- Returns:
- A new header bean, or null if the value isnull .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
ofStatic creator.- Parameters:
- name- The header name.
- value- The header value.
 Can be- null .
- Returns:
- A new header bean, or null if the value isnull .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
ofStatic creator with delayed value.Header value is re-evaluated on each call to getValue().- Parameters:
- name- The header name.
- value- The supplier of the header value.
 Can be- null .
- Returns:
- A new header bean, or null if the value isnull .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
getValue- Specified by:
- getValuein interface- NameValuePair
- Overrides:
- getValuein class- BasicHeader
 
- 
asArrayReturns the header value as an array wrapped in anOptional.The array is a copy of the value of this header. - Returns:
- The header value as an array wrapped in an Optional. Nevernull .
 
- 
toArrayReturns the header value as an array.The array is a copy of the value of this header. - Returns:
- The header value as an array.  Can be null .
 
- 
asListReturns the header value as a list wrapped in anOptional.The list is unmodifiable. - Returns:
- The header value as a list wrapped in an Optional. Nevernull .
 
- 
toListReturns the header value as a list.The list is unmodifiable. - Returns:
- The header value as a list.  Can be null .
 
- 
containsReturnstrue if this header contains the specified value.- Parameters:
- val- The value to check for.
- Returns:
- true if this header contains the specified value.
 
- 
containsIgnoreCaseReturnstrue if this header contains the specified value usingString.equalsIgnoreCase(String).- Parameters:
- val- The value to check for.
- Returns:
- true if this header contains the specified value.
 
- 
assertListProvides the ability to perform fluent-style assertions on this header.- Returns:
- A new fluent assertion object.
- Throws:
- AssertionError- If assertion failed.
 
- 
orElseReturn the value if present, otherwise returnother .This is a shortened form for calling asArray().orElse( .other )- Parameters:
- other- The value to be returned if there is no value present, can be- null .
- Returns:
- The value, if present, otherwise other .
 
 
-