Interface BodyAdapter.Hints
- Enclosing interface:
BodyAdapter
public static interface BodyAdapter.Hints
A collection of hints that provide additional context to customize an adapter's
encoding/decoding behavior. Typically, an adapter receives a
Hints object that contains
the MediaType of the intended format as advertised by the request or response.
Additionally, an encoder receives a Hints objects containing the request(),
and a decoder receives one that contains the responseInfo(). Some hints are optional,
and adapters substitute with default values in the absence thereof (for instance, a JSON
adapter may use UTF-8 in the absence of a MediaType containing a charset parameter). If
a hint is required by the adapter, it throws an UnsupportedOperationException in the
absence of such.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA builder ofHintobjects. -
Method Summary
Modifier and TypeMethodDescriptionstatic BodyAdapter.Hintsempty()Returns aHintsobject containing no hints.boolean<T> Optional<T> Returns the hint mapped to by the given type.inthashCode()Returns theMediaTypehint.default MediaTypeReturns either theMediaTypehint orMediaType.ANYif absent.default BodyAdapter.Hints.Buildermutate()Returns a newBuildercontaining this object's hints.static BodyAdapter.Hints.BuilderReturns a newBuilder.static BodyAdapter.HintsReturns aHintsobject containing the given media type.default Optional<HttpRequest> request()Returns theHttpRequesthint.default Optional<HttpResponse.ResponseInfo> Returns theResponseInfohint.toMap()Returns an immutable map of all hints.
-
Method Details
-
toMap
-
mediaType
-
mediaTypeOrAny
Returns either theMediaTypehint orMediaType.ANYif absent. -
request
Returns theHttpRequesthint. -
responseInfo
Returns theResponseInfohint. -
get
-
mutate
Returns a newBuildercontaining this object's hints. -
equals
-
hashCode
-
newBuilder
Returns a newBuilder. -
empty
Returns aHintsobject containing no hints. -
of
Returns aHintsobject containing the given media type.
-