@BeanIgnore public class BasicHeader extends Object implements Header, Cloneable, Serializable
Suppliers
.
Constructor and Description |
---|
BasicHeader(String name,
Object value)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
FluentStringAssertion<BasicHeader> |
assertName()
Provides an object for performing assertions against the name of this header.
|
FluentStringAssertion<BasicHeader> |
assertValue()
Provides an object for performing assertions against the value of this header.
|
static boolean |
canCast(Object o)
Returns
cast(Object) method can be used on the specified object. |
static Header |
cast(Object o)
Utility method for converting an arbitrary object to a
Header . |
protected boolean |
eqIC(String compare)
Returns
String.equalsIgnoreCase(String) . |
boolean |
equals(Object o) |
HeaderElement[] |
getElements() |
String |
getName() |
protected Object |
getRawValue()
Returns the raw value of the header.
|
String |
getValue() |
int |
hashCode() |
protected boolean |
isSupplier(Object o)
Returns
Supplier . |
static Header |
of(NameValuePair o)
Convenience creator.
|
static BasicHeader |
of(String name,
Object value)
Convenience creator.
|
static BasicHeader |
of(String name,
Supplier<?> value)
Convenience creator using supplier.
|
static BasicHeader |
ofPair(String pair)
Creates a
Header from a name/value pair string (e.g. |
String |
toString() |
protected static Object |
unwrap(Object o)
If the specified object is a
Supplier , returns the supplied value, otherwise the same value. |
public BasicHeader(String name, Object value)
name
- The parameter name.value
- The parameter value.
Object.toString()
.
Supplier
.public static BasicHeader of(String name, Object value)
name
- The parameter name.value
- The parameter value.
Object.toString()
.BasicHeader
object.public static BasicHeader ofPair(String pair)
Header
from a name/value pair string (e.g. pair
- The pair string.Header
object.public static Header of(NameValuePair o)
o
- The name value pair that makes up the header name and value.
The parameter value.
Object.toString()
.BasicHeader
object.public static BasicHeader of(String name, Supplier<?> value)
Header value is re-evaluated on each call to getValue()
.
name
- The parameter name.value
- The parameter value supplier.
Object.toString()
.BasicHeader
object.public static Header cast(Object o)
Header
.public static boolean canCast(Object o)
cast(Object)
method can be used on the specified object.o
- The object to check.cast(Object)
method can be used on the specified object.public String getName()
getName
in interface NameValuePair
public String getValue()
getValue
in interface NameValuePair
protected Object getRawValue()
public HeaderElement[] getElements() throws ParseException
getElements
in interface Header
ParseException
protected boolean eqIC(String compare)
String.equalsIgnoreCase(String)
.compare
- The value to compare against.public FluentStringAssertion<BasicHeader> assertName()
public FluentStringAssertion<BasicHeader> assertValue()
protected boolean isSupplier(Object o)
Supplier
.o
- The object to check.Supplier
.protected static Object unwrap(Object o)
Supplier
, returns the supplied value, otherwise the same value.o
- The object to unwrap.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.