Class BodyAdapter.Hints.Builder

java.lang.Object
com.github.mizosoft.methanol.BodyAdapter.Hints.Builder
Enclosing interface:
BodyAdapter.Hints

public static class BodyAdapter.Hints.Builder extends Object
A builder of Hint objects.
  • Method Details

    • forEncoder

      @CanIgnoreReturnValue public BodyAdapter.Hints.Builder forEncoder(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(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(Class<T> type, T value)
      Maps the given type to the given hint.
    • remove

      @CanIgnoreReturnValue public <T> BodyAdapter.Hints.Builder remove(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 new Hints object containing the hints added so far.