Class CharSequenceEncoder

java.lang.Object
com.github.mizosoft.methanol.adapter.AbstractBodyAdapter
com.github.mizosoft.methanol.testing.CharSequenceEncoder
All Implemented Interfaces:
BodyAdapter, BodyAdapter.Encoder

public final class CharSequenceEncoder extends AbstractBodyAdapter implements BodyAdapter.Encoder
  • Constructor Details

    • CharSequenceEncoder

      public CharSequenceEncoder()
  • Method Details

    • supportsType

      public boolean supportsType(TypeRef<?> type)
      Description copied from interface: BodyAdapter
      Returns true if this adapter supports the given type.
      Specified by:
      supportsType in interface BodyAdapter
    • toBody

      public HttpRequest.BodyPublisher toBody(Object object, @Nullable MediaType mediaType)
      Description copied from interface: BodyAdapter.Encoder
      Returns a BodyPublisher that encodes the given object into a request body using the format specified by the given media type. If mediaType is null, the encoder's default format parameters (e.g. charset) are be used.
      Specified by:
      toBody in interface BodyAdapter.Encoder