@BeanIgnore public class BasicNameValuePair extends Object implements NameValuePair, Headerable
NameValuePair
for serializing POJOs as URL-encoded form post entries.
Provides the following features:
Suppliers
.
Constructor and Description |
---|
BasicNameValuePair(String name,
Object value)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
BasicHeader |
asHeader()
Convert the object to a
Header . |
FluentStringAssertion<BasicNameValuePair> |
assertName()
Provides an object for performing assertions against the name of this pair.
|
FluentStringAssertion<BasicNameValuePair> |
assertValue()
Provides an object for performing assertions against the value of this pair.
|
static boolean |
canCast(Object o)
Returns
cast(Object) method can be used on the specified object. |
static NameValuePair |
cast(Object o)
Utility method for converting an arbitrary object to a
NameValuePair . |
String |
getName() |
String |
getValue() |
static BasicNameValuePair |
of(String name,
Object value)
Convenience creator.
|
static BasicNameValuePair |
of(String name,
Supplier<?> value)
Convenience creator using supplier.
|
static BasicNameValuePair |
ofPair(String pair)
Creates a
NameValuePair from a name/value pair string (e.g. |
String |
toString() |
public BasicNameValuePair(String name, Object value)
name
- The parameter name.value
- The POJO to serialize to the parameter value.public static BasicNameValuePair of(String name, Object value)
name
- The parameter name.value
- The parameter value.BasicNameValuePair
object.public static BasicNameValuePair ofPair(String pair)
NameValuePair
from a name/value pair string (e.g. pair
- The pair string.NameValuePair
object.public static BasicNameValuePair of(String name, Supplier<?> value)
Value is re-evaluated on each call to getValue()
.
name
- The parameter name.value
- The parameter value supplier.BasicNameValuePair
object.public static NameValuePair cast(Object o)
NameValuePair
.o
- The object to cast or convert to a NameValuePair
.NameValuePair
or converted to a NameValuePair
.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 FluentStringAssertion<BasicNameValuePair> assertName()
public FluentStringAssertion<BasicNameValuePair> assertValue()
public BasicHeader asHeader()
Headerable
Header
.asHeader
in interface Headerable
Header
.public String getName()
getName
in interface NameValuePair
public String getValue()
getValue
in interface NameValuePair
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.