Package org.apache.juneau.http.part
Class BasicUriPart
java.lang.Object
org.apache.juneau.http.part.BasicPart
org.apache.juneau.http.part.BasicUriPart
- All Implemented Interfaces:
NameValuePair
,Headerable
-
Constructor Summary
ConstructorDescriptionBasicUriPart
(String name, String value) Constructor.BasicUriPart
(String name, URI value) Constructor.BasicUriPart
(String name, Supplier<URI> value) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionasUri()
static BasicUriPart
Static creator.static BasicUriPart
Static creator with delayed value.Return the value if present, otherwise returnother .toUri()
Returns The part value as aURI
.Methods inherited from class org.apache.juneau.http.part.BasicPart
asHeader, assertName, assertValue, canCast, cast, getName, getRawValue, getValue, of, ofPair, toString
-
Constructor Details
-
BasicUriPart
Constructor.- Parameters:
name
- The part name. Must not benull .value
- The part value. Can benull .
-
BasicUriPart
Constructor.- Parameters:
name
- The part name. Must not benull .value
- The part value supplier. Can benull or supplynull .
-
BasicUriPart
Constructor.null and empty values are treated asnull . Otherwise parses usingURI.create(String)
.- Parameters:
name
- The part name. Must not benull .value
- The part value. Can benull .
-
-
Method Details
-
of
Static creator.- Parameters:
name
- The part name.value
- The part value.- Returns:
- A new
BasicUriPart
object, ornull if the name or value isnull .
-
of
Static 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
BasicUriPart
object, ornull if the name or supplier isnull .
-
asUri
-
toUri
Returns The part value as aURI
.- Returns:
- The part value as a
URI
, ornull if the valuenull .
-
orElse
Return 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 benull .- Returns:
- The value, if present, otherwise
other .
-