Module methanol

Class BodyAdapter.Hints.Builder

  • Enclosing interface:
    BodyAdapter.Hints

    public static class BodyAdapter.Hints.Builder
    extends java.lang.Object
    A builder of Hint objects.
    • 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 or Content-Type header, whichever is present first.
      • forDecoder

        @CanIgnoreReturnValue
        public BodyAdapter.Hints.Builder forDecoder​(java.net.http.HttpResponse.ResponseInfo responseInfo)
        Adds the given ResponseInfo as 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.
      • build

        public BodyAdapter.Hints build()
        Returns a new Hints object containing the hints added so far.