Package org.apache.juneau.http.part
Class BasicBooleanPart
java.lang.Object
org.apache.juneau.http.part.BasicPart
org.apache.juneau.http.part.BasicBooleanPart
- All Implemented Interfaces:
- NameValuePair,- Headerable
- 
Constructor SummaryConstructorsConstructorDescriptionBasicBooleanPart(String name, Boolean value) Constructor.BasicBooleanPart(String name, String value) Constructor.BasicBooleanPart(String name, Supplier<Boolean> value) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionProvides the ability to perform fluent-style assertions on this part.getValue()static BasicBooleanPartStatic creator.static BasicBooleanPartStatic creator with delayed value.Return the value if present, otherwise returnother .Returns The part value as aBoolean.Methods inherited from class org.apache.juneau.http.part.BasicPartasHeader, assertName, assertValue, canCast, cast, getName, getRawValue, of, ofPair, toString
- 
Constructor Details- 
BasicBooleanPartConstructor.- Parameters:
- name- The part name. Must not be- null .
- value- The part value. Can be- null .
 
- 
BasicBooleanPartConstructor.- Parameters:
- name- The part name. Must not be- null .
- value- The part value supplier. Can be- null or supply- null .
 
- 
BasicBooleanPartConstructor.null and empty values are treated asnull . Otherwise parses usingBoolean.valueOf(String).- Parameters:
- name- The part name. Must not be- null .
- value- The part value. Can be- null .
 
 
- 
- 
Method Details- 
ofStatic creator.- Parameters:
- name- The part name.
- value- The part value.
- Returns:
- A new BasicBooleanPartobject, 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 BasicBooleanPartobject, ornull if the name or supplier isnull .
 
- 
getValue- Specified by:
- getValuein interface- NameValuePair
- Overrides:
- getValuein class- BasicPart
 
- 
asBoolean
- 
toBooleanReturns The part value as aBoolean.- Returns:
- The part value as a Boolean, ornull if the valuenull .
 
- 
assertBooleanProvides the ability to perform fluent-style assertions on this part.- 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 asBoolean().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 .
 
 
-