Uses of Class
com.github.mizosoft.methanol.MediaType
-
Packages that use MediaType Package Description com.github.mizosoft.methanol com.github.mizosoft.methanol.adapter com.github.mizosoft.methanol.internal com.github.mizosoft.methanol.internal.extensions -
-
Uses of MediaType in com.github.mizosoft.methanol
Fields in com.github.mizosoft.methanol declared as MediaType Modifier and Type Field Description static MediaTypeMediaType. ANY*/*static MediaTypeMediaType. APPLICATION_ANYapplication/*static MediaTypeMediaType. APPLICATION_FORM_URLENCODEDapplication/x-www-form-urlencodedstatic MediaTypeMediaType. APPLICATION_JSONapplication/jsonstatic MediaTypeMediaType. APPLICATION_OCTET_STREAMapplication/octet-streamstatic MediaTypeMediaType. APPLICATION_X_PROTOBUFapplication/x-protobufstatic MediaTypeMediaType. APPLICATION_XHTML_XMLapplication/xhtml+xmlstatic MediaTypeMediaType. APPLICATION_XMLapplication/xmlstatic MediaTypeMediaType. IMAGE_ANYimage/*static MediaTypeMediaType. IMAGE_GIFimage/gifstatic MediaTypeMediaType. IMAGE_JPEGimage/jpegstatic MediaTypeMediaType. IMAGE_PNGimage/pngstatic MediaTypeMediaType. TEXT_ANYtext/*static MediaTypeMediaType. TEXT_HTMLtext/htmlstatic MediaTypeMediaType. TEXT_MARKDOWNtext/markdownstatic MediaTypeMediaType. TEXT_PLAINtext/plainstatic MediaTypeMediaType. TEXT_XMLtext/xmlMethods in com.github.mizosoft.methanol that return MediaType Modifier and Type Method Description MediaTypeFormBodyPublisher. mediaType()MediaTypeMimeBodyPublisher. mediaType()Returns the body's media type.MediaTypeMultipartBodyPublisher. mediaType()default MediaTypeBodyAdapter.Hints. mediaTypeOrAny()Returns either theMediaTypehint orANYif absent.static MediaTypeMediaType. of(java.lang.String type, java.lang.String subtype)Returns a newMediaTypewith the given type and subtype.static MediaTypeMediaType. of(java.lang.String type, java.lang.String subtype, java.util.Map<java.lang.String,java.lang.String> parameters)Returns a newMediaTypewith the given type, subtype and parameters.static MediaTypeMediaType. parse(java.lang.String value)Parses the given string into aMediaTypeinstance.MediaTypeMediaType. withCharset(java.nio.charset.Charset charset)Returns a newMediaTypewith this instance's type, subtype and parameters but with the name of the given charset as the value of the charset parameter.MediaTypeMediaType. withParameter(java.lang.String name, java.lang.String value)Returns a newMediaTypewith this instance's type, subtype and parameters but with the value of the parameter specified by the given name set to the given value.MediaTypeMediaType. withParameters(java.util.Map<java.lang.String,java.lang.String> parameters)Returns a newMediaTypewith this instance's type, subtype and parameters but with each of the given parameters' names set to their corresponding values.Methods in com.github.mizosoft.methanol that return types with arguments of type MediaType Modifier and Type Method Description default java.util.Optional<MediaType>BodyAdapter.Hints. mediaType()Returns theMediaTypehint.Methods in com.github.mizosoft.methanol with parameters of type MediaType Modifier and Type Method Description MultipartBodyPublisher.BuilderMultipartBodyPublisher.Builder. filePart(java.lang.String name, java.nio.file.Path file, MediaType mediaType)Adds a file form field with given name, file and media type.MultipartBodyPublisher.BuilderMultipartBodyPublisher.Builder. formPart(java.lang.String name, java.lang.String filename, java.net.http.HttpRequest.BodyPublisher bodyPublisher, MediaType mediaType)Adds a form field with the given name, filename, body and media type.static java.util.Optional<BodyAdapter.Decoder>BodyAdapter.Decoder. getDecoder(TypeRef<?> typeRef, @Nullable MediaType mediaType)Returns a registered decoder that supports the given object type and media type, if any.static java.util.Optional<BodyAdapter.Encoder>BodyAdapter.Encoder. getEncoder(TypeRef<?> typeRef, @Nullable MediaType mediaType)Returns a registered encoder that supports the given object type and media type, if any.booleanMediaType. includes(MediaType other)Returns whether this media type includes the given one.booleanResponsePayload. is(MediaType mediaType)Returns true if this payload has the given media type.default booleanResponsePayload. isAnyOf(MediaType... mediaTypes)Returns true if this payload has any of the given media types.booleanBodyAdapter. isCompatibleWith(MediaType mediaType)Returnstrueif the format this adapter uses iscompatiblewith the given media type.booleanMediaType. isCompatibleWith(MediaType other)Returns whether this media type is compatible with the given one.MultipartBodyPublisher.BuilderMultipartBodyPublisher.Builder. mediaType(MediaType mediaType)Sets the media type of the multipart body.MutableRequestMutableRequest. method(java.lang.String method, java.lang.Object payload, MediaType mediaType)Sets the request method and sets the payload to the given value.<T> MutableRequestMutableRequest. method(java.lang.String method, T payload, TypeRef<T> typeRef, MediaType mediaType)Sets the request method and sets the payload to the given value with an explicitly specified type.static BodyAdapter.HintsBodyAdapter.Hints. of(MediaType mediaType)Returns aHintsobject containing the given media type.static <T> java.net.http.HttpResponse.BodySubscriber<java.util.function.Supplier<T>>MoreBodySubscribers. ofDeferredObject(TypeRef<T> type, @Nullable MediaType mediaType)Returns aBodySubscriberthat decodes the response body into an object of the given type using an installeddecoder.static MimeBodyPublisherMoreBodyPublishers. ofMediaType(java.net.http.HttpRequest.BodyPublisher bodyPublisher, MediaType mediaType)Adapts the givenBodyPublisherinto aMimeBodyPublisherwith the given media type.static java.net.http.HttpRequest.BodyPublisherMoreBodyPublishers. ofObject(java.lang.Object object, @Nullable MediaType mediaType)Returns aBodyPublisherthat encodes the given object into a request body using an installedencoder.static <T> java.net.http.HttpResponse.BodySubscriber<T>MoreBodySubscribers. ofObject(TypeRef<T> type, @Nullable MediaType mediaType)Returns aBodySubscriberthat decodes the response body into an object of the given type using an installeddecoder.MutableRequestMutableRequest. PATCH(java.lang.Object payload, MediaType mediaType)Sets the request method to PATCH and sets the payload to the given value.static MutableRequestMutableRequest. PATCH(java.lang.String uri, java.lang.Object payload, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PATCH method.static <T> MutableRequestMutableRequest. PATCH(java.lang.String uri, T payload, TypeRef<T> typeRef, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PATCH method.static MutableRequestMutableRequest. PATCH(java.net.URI uri, java.lang.Object payload, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PATCH method.static <T> MutableRequestMutableRequest. PATCH(java.net.URI uri, T payload, TypeRef<T> typeRef, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PATCH method.<T> MutableRequestMutableRequest. PATCH(T payload, TypeRef<T> typeRef, MediaType mediaType)Sets the request method to PATCH and sets the payload to the given value with an explicitly specified type.MutableRequestMutableRequest. POST(java.lang.Object payload, MediaType mediaType)Sets the request method to POST and sets the payload to the given value.static MutableRequestMutableRequest. POST(java.lang.String uri, java.lang.Object payload, MediaType mediaType)Returns a newMutableRequestwith the given URI and a POST method.static <T> MutableRequestMutableRequest. POST(java.lang.String uri, T payload, TypeRef<T> typeRef, MediaType mediaType)Returns a newMutableRequestwith the given URI and a POST method.static MutableRequestMutableRequest. POST(java.net.URI uri, java.lang.Object payload, MediaType mediaType)Returns a newMutableRequestwith the given URI and a POST method.static <T> MutableRequestMutableRequest. POST(java.net.URI uri, T payload, TypeRef<T> typeRef, MediaType mediaType)Returns a newMutableRequestwith the given URI and a POST method.<T> MutableRequestMutableRequest. POST(T payload, TypeRef<T> typeRef, MediaType mediaType)Sets the request method to POST and sets the payload to the given value with an explicitly specified type.MutableRequestMutableRequest. PUT(java.lang.Object payload, MediaType mediaType)Sets the request method to PUT and sets the payload to the given value.static MutableRequestMutableRequest. PUT(java.lang.String uri, java.lang.Object payload, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PUT method.static <T> MutableRequestMutableRequest. PUT(java.lang.String uri, T payload, TypeRef<T> typeRef, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PUT method.static MutableRequestMutableRequest. PUT(java.net.URI uri, java.lang.Object payload, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PUT method.static <T> MutableRequestMutableRequest. PUT(java.net.URI uri, T payload, TypeRef<T> typeRef, MediaType mediaType)Returns a newMutableRequestwith the given URI and a PUT method.<T> MutableRequestMutableRequest. PUT(T payload, TypeRef<T> typeRef, MediaType mediaType)Sets the request method to PUT and sets the payload to the given value with an explicitly specified type.java.net.http.HttpRequest.BodyPublisherBodyAdapter.Encoder. toBody(java.lang.Object value, @Nullable MediaType mediaType)Returns aHttpRequest.BodyPublisherthat encodes the given object into a request body using the format specified by the given media type.default <T> java.net.http.HttpResponse.BodySubscriber<java.util.function.Supplier<T>>BodyAdapter.Decoder. toDeferredObject(TypeRef<T> typeRef, @Nullable MediaType mediaType)Returns a completedHttpResponse.BodySubscriberthat lazily decodes the response body into an object of the given type using the format specified by the given media type.<T> java.net.http.HttpResponse.BodySubscriber<T>BodyAdapter.Decoder. toObject(TypeRef<T> typeRef, @Nullable MediaType mediaType)Returns aHttpResponse.BodySubscriberthat decodes the response body into an object of the given type using the format specified by the given media type. -
Uses of MediaType in com.github.mizosoft.methanol.adapter
Methods in com.github.mizosoft.methanol.adapter that return types with arguments of type MediaType Modifier and Type Method Description protected java.util.Set<MediaType>AbstractBodyAdapter. compatibleMediaTypes()Returns an immutable set containing the media types this adapter is compatible with.Methods in com.github.mizosoft.methanol.adapter with parameters of type MediaType Modifier and Type Method Description static java.net.http.HttpRequest.BodyPublisherAbstractBodyAdapter. attachMediaType(java.net.http.HttpRequest.BodyPublisher publisher, @Nullable MediaType mediaType)Converts the given publisher into aMimeBodyPublisherthat has the given media type only if it is notnullorhas a wildcard, otherwise the given publisher is returned as-is.static java.nio.charset.CharsetAbstractBodyAdapter. charsetOrDefault(@Nullable MediaType mediaType, java.nio.charset.Charset defaultCharset)Returns either the result ofcharsetOrDefault(Charset), or the given charset if the given media type isnull.static java.nio.charset.CharsetAbstractBodyAdapter. charsetOrUtf8(@Nullable MediaType mediaType)booleanAbstractBodyAdapter. isCompatibleWith(MediaType mediaType)booleanForwardingBodyAdapter. isCompatibleWith(MediaType mediaType)protected voidAbstractBodyAdapter. requireCompatibleOrNull(@Nullable MediaType mediaType)Requires that either this adapter iscompatiblewith the given media type, or the given media type isnull.default java.net.http.HttpRequest.BodyPublisherAbstractBodyAdapter.BaseEncoder. toBody(java.lang.Object value, @Nullable MediaType mediaType)Returns aHttpRequest.BodyPublisherthat encodes the given object into a request body using the format specified by the given media type.java.net.http.HttpRequest.BodyPublisherForwardingEncoder. toBody(java.lang.Object value, @Nullable MediaType mediaType)default <T> java.net.http.HttpResponse.BodySubscriber<java.util.function.Supplier<T>>AbstractBodyAdapter.BaseDecoder. toDeferredObject(TypeRef<T> typeRef, @Nullable MediaType mediaType)Returns a completedHttpResponse.BodySubscriberthat lazily decodes the response body into an object of the given type using the format specified by the given media type.<T> java.net.http.HttpResponse.BodySubscriber<java.util.function.Supplier<T>>ForwardingDecoder. toDeferredObject(TypeRef<T> typeRef, @Nullable MediaType mediaType)default <T> java.net.http.HttpResponse.BodySubscriber<T>AbstractBodyAdapter.BaseDecoder. toObject(TypeRef<T> typeRef, @Nullable MediaType mediaType)Returns aHttpResponse.BodySubscriberthat decodes the response body into an object of the given type using the format specified by the given media type.<T> java.net.http.HttpResponse.BodySubscriber<T>ForwardingDecoder. toObject(TypeRef<T> typeRef, @Nullable MediaType mediaType)Constructors in com.github.mizosoft.methanol.adapter with parameters of type MediaType Constructor Description AbstractBodyAdapter(MediaType... compatibleMediaTypes)Creates anAbstractBodyAdaptercompatible with the given media types. -
Uses of MediaType in com.github.mizosoft.methanol.internal
Methods in com.github.mizosoft.methanol.internal with parameters of type MediaType Modifier and Type Method Description static BodyAdapter.HintsUtils. hintsOf(@Nullable MediaType mediaType) -
Uses of MediaType in com.github.mizosoft.methanol.internal.extensions
Methods in com.github.mizosoft.methanol.internal.extensions that return MediaType Modifier and Type Method Description MediaTypeMimeBodyPublisherAdapter. mediaType()Constructors in com.github.mizosoft.methanol.internal.extensions with parameters of type MediaType Constructor Description MimeBodyPublisherAdapter(java.net.http.HttpRequest.BodyPublisher upstream, MediaType mediaType)
-