- java.lang.Object
-
- com.github.mizosoft.methanol.BodyAdapter.Hints.Builder
-
- Enclosing interface:
- BodyAdapter.Hints
public static class BodyAdapter.Hints.Builder extends java.lang.ObjectA builder ofHintobjects.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BodyAdapter.Hintsbuild()Returns a newHintsobject containing the hints added so far.BodyAdapter.Hints.BuilderforDecoder(java.net.http.HttpResponse.ResponseInfo responseInfo)Adds the givenResponseInfoas a hint and a media type hint extracted from the response headers if present.BodyAdapter.Hints.BuilderforEncoder(java.net.http.HttpRequest request)Adds the given request as a hint and a media type hint extracted from either the request's body orContent-Typeheader, whichever is present first.<T> BodyAdapter.Hints.Builderput(java.lang.Class<T> type, T value)Maps the given type to the given hint.<T> BodyAdapter.Hints.Builderremove(java.lang.Class<T> type)Removes the hint mapped to by the given type.BodyAdapter.Hints.BuilderremoveAll()Removes all hints added so far.
-
-
-
Method Detail
-
forEncoder
@CanIgnoreReturnValue public BodyAdapter.Hints.Builder forEncoder(java.net.http.HttpRequest request)
Adds the given request as a hint and a media type hint extracted from either the request's body orContent-Typeheader, whichever is present first.
-
forDecoder
@CanIgnoreReturnValue public BodyAdapter.Hints.Builder forDecoder(java.net.http.HttpResponse.ResponseInfo responseInfo)
Adds the givenResponseInfoas a hint and a media type hint extracted from the response headers if present.
-
put
@CanIgnoreReturnValue public <T> BodyAdapter.Hints.Builder put(java.lang.Class<T> type, T value)
Maps the given type to the given hint.
-
remove
@CanIgnoreReturnValue public <T> BodyAdapter.Hints.Builder remove(java.lang.Class<T> type)
Removes the hint mapped to by the given type.
-
removeAll
@CanIgnoreReturnValue public BodyAdapter.Hints.Builder removeAll()
Removes all hints added so far.
-
build
public BodyAdapter.Hints build()
Returns a newHintsobject containing the hints added so far.
-
-