Package org.apache.juneau.http.part
Class BasicStringPart
java.lang.Object
org.apache.juneau.http.part.BasicPart
org.apache.juneau.http.part.BasicStringPart
- All Implemented Interfaces:
- NameValuePair,- Headerable
- 
Constructor SummaryConstructorsConstructorDescriptionBasicStringPart(String name, String value) Constructor.BasicStringPart(String name, Supplier<String> value) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionProvides the ability to perform fluent-style assertions on this part.asString()getValue()static BasicStringPartStatic creator.static BasicStringPartStatic creator with delayed value.Return the value if present, otherwise returnother .Methods inherited from class org.apache.juneau.http.part.BasicPartasHeader, assertName, assertValue, canCast, cast, getName, getRawValue, of, ofPair, toString
- 
Constructor Details- 
BasicStringPartConstructor.- Parameters:
- name- The part name. Must not be- null .
- value- The part value. Can be- null .
 
- 
BasicStringPartConstructor.- Parameters:
- name- The part name. Must not be- null .
- value- The part value supplier. Can be- null or supply- null .
 
 
- 
- 
Method Details- 
ofStatic creator.- Parameters:
- name- The part name.
- value- The part value.
- Returns:
- A new BasicStringPartobject, ornull if the name or value isnull .
 
- 
ofStatic creator with delayed value.Part value is re-evaluated on each call to NameValuePair.getValue().- Parameters:
- name- The part name.
- value- The part value supplier.
- Returns:
- A new BasicStringPartobject, ornull if the name or supplier isnull .
 
- 
assertStringProvides the ability to perform fluent-style assertions on this part.- Returns:
- A new fluent assertion object.
- Throws:
- AssertionError- If assertion failed.
 
- 
getValue- Specified by:
- getValuein interface- NameValuePair
- Overrides:
- getValuein class- BasicPart
 
- 
asString
- 
orElseReturn the value if present, otherwise returnother .This is a shortened form for calling asString().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 .
 
 
-