Package org.apache.juneau.http.part
Class HttpPartBean
java.lang.Object
org.apache.juneau.http.part.HttpPartBean
- All Implemented Interfaces:
HttpPart
- Direct Known Subclasses:
HttpBooleanPart,HttpCsvArrayPart,HttpDatePart,HttpIntegerPart,HttpLongPart,HttpStringPart,HttpUriPart
Root concrete implementation of
HttpPart.
Holds a name/value pair representing a query parameter, form field, or path variable. The value may be
supplied eagerly (as a String) or lazily (via a Supplier). A null value signals
that the part should be omitted from the request.
Create instances via the static factory methods:
See Also:
- Since:
- 9.2.1
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpPartBean(String name, String value) Constructor.protectedHttpPartBean(String name, Supplier<String> valueSupplier) Constructor with lazy value supplier. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetName()Returns the part name.getValue()Returns the part value, ornull if the part should be omitted.inthashCode()static HttpPartBeanCreates anHttpPartBeanwith an eager string value.static HttpPartBeanCreates anHttpPartBeanwith a lazy value supplier.toString()
-
Constructor Details
-
HttpPartBean
Constructor.- Parameters:
name- The part name. Must not benull .value- The part value. May benull .
-
HttpPartBean
Constructor with lazy value supplier.- Parameters:
name- The part name. Must not benull .valueSupplier- Supplier that provides the value at request time. Must not benull .
-
-
Method Details
-
of
Creates anHttpPartBeanwith an eager string value.- Parameters:
name- The part name. Must not benull .value- The part value. May benull .- Returns:
- A new instance. Never
null .
-
of
Creates anHttpPartBeanwith a lazy value supplier.The supplier is evaluated at request-send time; if it returns
nullthe part is omitted.- Parameters:
name- The part name. Must not benull .valueSupplier- Supplier for the part value. Must not benull .- Returns:
- A new instance. Never
null .
-
getName
Description copied from interface:HttpPartReturns the part name. -
getValue
Description copied from interface:HttpPartReturns the part value, ornull if the part should be omitted. -
toString
-
equals
-
hashCode
-