Package org.apache.juneau.http.part
Class BasicPart
java.lang.Object
org.apache.juneau.http.part.BasicPart
- All Implemented Interfaces:
- NameValuePair,- Headerable
- Direct Known Subclasses:
- BasicBooleanPart,- BasicCsvArrayPart,- BasicDatePart,- BasicIntegerPart,- BasicLongPart,- BasicStringPart,- BasicUriPart,- SerializedPart
Implementation of 
NameValuePair for serializing POJOs as URL-encoded form post entries.
 Provides the following features:
 - 
      Values from Suppliers.
- Caching.
- Fluent setters.
- Fluent assertions.
See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionasHeader()Convert the object to aHeader.Provides an object for performing assertions against the name of this pair.Provides an object for performing assertions against the value of this pair.static booleanReturnstrue if thecast(Object)method can be used on the specified object.static NameValuePairUtility method for converting an arbitrary object to aNameValuePair.getName()Returns the raw value of the part.getValue()static BasicPartStatic creator.static BasicPartCreates aNameValuePairfrom a name/value pair string (e.g.toString()
- 
Constructor Details- 
BasicPartConstructor.- Parameters:
- name- The part name.
- value- The POJO to serialize to The part value.
 
- 
BasicPartCopy constructor.- Parameters:
- copyFrom- The object to copy.
 
 
- 
- 
Method Details- 
ofStatic creator.- Parameters:
- name- The part name.
- value- The part value.
- Returns:
- A new BasicPartobject.
 
- 
ofPairCreates aNameValuePairfrom a name/value pair string (e.g."Foo: bar" )- Parameters:
- pair- The pair string.
- Returns:
- A new NameValuePairobject.
 
- 
castUtility method for converting an arbitrary object to aNameValuePair.- Parameters:
- o- The object to cast or convert to a- NameValuePair.
- Returns:
- Either the same object cast as a NameValuePairor converted to aNameValuePair.
 
- 
canCastReturnstrue if thecast(Object)method can be used on the specified object.- Parameters:
- o- The object to check.
- Returns:
- true if the- cast(Object)method can be used on the specified object.
 
- 
assertNameProvides an object for performing assertions against the name of this pair.- Returns:
- An object for performing assertions against the name of this pair.
 
- 
assertValueProvides an object for performing assertions against the value of this pair.- Returns:
- An object for performing assertions against the value of this pair.
 
- 
asHeaderDescription copied from interface:HeaderableConvert the object to aHeader.- Specified by:
- asHeaderin interface- Headerable
- Returns:
- The object converted to a Header.
 
- 
getName- Specified by:
- getNamein interface- NameValuePair
 
- 
getValue- Specified by:
- getValuein interface- NameValuePair
 
- 
getRawValueReturns the raw value of the part.- Returns:
- The raw value of the part.
 
- 
toString
 
-