Uses of Class
com.github.mizosoft.methanol.TypeRef
Packages that use TypeRef
-
Uses of TypeRef in com.github.mizosoft.methanol
Methods in com.github.mizosoft.methanol that return TypeRefModifier and TypeMethodDescriptionstatic <U> TypeRef<U> Deprecated.static TypeRef<?> Deprecated.in favor ofTypeRef.of(Type).static <U> TypeRef<U> Returns a newTypeRefwho'sTypeRef.type()is the given class.static TypeRef<?> Returns a newTypeRefwho'sTypeRef.type()is the given type.static <T> TypeRef<? extends T> TypeRef.ofRuntimeType(T instance) Returns a newTypeRefwho'sTypeRef.type()is the runtime type of the given instance.TypeRef.resolveSupertype(Class<?> supertype) Resolves the given supertype into a type with concrete type arguments (if any) that are derived from this type (i.e.Methods in com.github.mizosoft.methanol that return types with arguments of type TypeRefModifier and TypeMethodDescriptionTypeRef.typeArgumentAt(int i) Returns the type argument ofTat the given index, provided thatTis aparameterized typethat has at least as many arguments as the given index.TypeRef.typeArguments()Returns a list ofTypeRef<?>corresponding toT's type arguments, provided it is aparameterized type, otherwise an empty list is returned.Methods in com.github.mizosoft.methanol with parameters of type TypeRefModifier and TypeMethodDescription<T> HttpResponse.BodyHandler<Supplier<T>> AdapterCodec.deferredHandlerOf(TypeRef<T> typeRef, BodyAdapter.Hints hints) Returns aBodyHandlerthat lazily decodes the response body into an object of the given type.<T> HttpResponse.BodySubscriber<Supplier<T>> AdapterCodec.deferredSubscriberOf(TypeRef<T> typeRef, BodyAdapter.Hints hints) Returns aHttpResponse.BodySubscriberthat lazily decodes the response body into an object of the given type.static 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 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.<T> HttpResponse.BodyHandler<T> AdapterCodec.handlerOf(TypeRef<T> typeRef, BodyAdapter.Hints hints) Returns aHttpResponse.BodyHandlerthat decodes the response body into an object of the given type.<T> MutableRequestSets the request method and sets the payload to the given value with an explicitly specified type.static <T> HttpResponse.BodyHandler<Supplier<T>> MoreBodyHandlers.ofDeferredObject(TypeRef<T> typeRef) Returns aBodyHandlerthat returns a subscriber obtained fromMoreBodySubscribers.ofDeferredObject(TypeRef, MediaType).static <T> HttpResponse.BodySubscriber<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 <T> HttpResponse.BodyHandler<T> Returns aBodyHandlerthat returns a subscriber obtained fromMoreBodySubscribers.ofObject(TypeRef, MediaType).static <T> HttpResponse.BodySubscriber<T> Returns aBodySubscriberthat decodes the response body into an object of the given type using an installeddecoder.static <T> MutableRequestReturns a newMutableRequestwith the given URI and a PATCH method.static <T> MutableRequestReturns a newMutableRequestwith the given URI and a PATCH method.<T> MutableRequestSets the request method to PATCH and sets the payload to the given value with an explicitly specified type.static <T> MutableRequestReturns a newMutableRequestwith the given URI and a POST method.static <T> MutableRequestReturns a newMutableRequestwith the given URI and a POST method.<T> MutableRequestSets the request method to POST and sets the payload to the given value with an explicitly specified type.AdapterCodec.publisherOf(T value, TypeRef<T> typeRef, BodyAdapter.Hints hints) Returns aHttpRequest.BodyPublisherthat encodes the given object into a request body with respect to the givenTypeRef.static <T> MutableRequestReturns a newMutableRequestwith the given URI and a PUT method.static <T> MutableRequestReturns a newMutableRequestwith the given URI and a PUT method.<T> MutableRequestSets the request method to PUT and sets the payload to the given value with an explicitly specified type.Removes the tag associated with the given type.<T> HttpResponse<T> Methanol.send(HttpRequest request, TypeRef<T> typeRef) Sendsthe given request and converts the response body into an object of the given type.<T> CompletableFuture<HttpResponse<T>> Methanol.sendAsync(HttpRequest request, TypeRef<T> typeRef) Asynchronously sendsthe given request and converts the response body into an object of the given type.<T> HttpResponse.BodySubscriber<T> AdapterCodec.subscriberOf(TypeRef<T> typeRef, BodyAdapter.Hints hints) Returns aHttpResponse.BodySubscriberthat decodes the response body into an object of the given type.booleanBodyAdapter.supportsType(TypeRef<?> typeRef) Returnstrueif this adapter supports the given type.<T> MutableRequestAdds a tag mapped to the given type.<T> Optional<T> Returns the tag associated with the given type if present.static <T> Optional<T> TaggableRequest.tagOf(HttpRequest request, TypeRef<T> typeRef) Returns the tag associated with the given type if the given request is aTaggableRequestand it has a tag with the given type, otherwise returns an emptyOptional.<T> TConverts this payload into an object of (possibly generic) typeT.<T> CompletableFuture<T> Asynchronously converts this payload into an object of (possibly generic) typeT.default <T> HttpRequest.BodyPublisherBodyAdapter.Encoder.toBody(T value, TypeRef<T> typeRef, BodyAdapter.Hints hints) Returns aHttpRequest.BodyPublisherthat encodes the given object into a request body based on the givenTypeRef, using the given hintsBodyAdapter.Hintsfor encoder-specific customization.default <T> HttpResponse.BodySubscriber<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.default <T> HttpResponse.BodySubscriber<Supplier<T>> BodyAdapter.Decoder.toDeferredObject(TypeRef<T> typeRef, BodyAdapter.Hints hints) Returns a completedHttpResponse.BodySubscriberthat lazily decodes the response body into an object of the given type using the givenBodyAdapter.Hints.<T> HttpResponse.BodySubscriber<T> Returns aHttpResponse.BodySubscriberthat decodes the response body into an object of the given type using the format specified by the given media type.default <T> HttpResponse.BodySubscriber<T> BodyAdapter.Decoder.toObject(TypeRef<T> typeRef, BodyAdapter.Hints hints) Returns aHttpResponse.BodySubscriberthat decodes the response body into an object of the given type using the givenBodyAdapter.Hints. -
Uses of TypeRef in com.github.mizosoft.methanol.adapter
Methods in com.github.mizosoft.methanol.adapter with parameters of type TypeRefModifier and TypeMethodDescriptionprotected voidAbstractBodyAdapter.requireSupport(TypeRef<?> typeRef) Requires that this adaptersupportsthe given type.protected voidAbstractBodyAdapter.requireSupport(TypeRef<?> typeRef, BodyAdapter.Hints hints) Requires that this adaptersupportsthe given type andis compatible withthe given hints' media type, if any.booleanForwardingBodyAdapter.supportsType(TypeRef<?> type) AbstractBodyAdapter.BaseEncoder.toBody(T value, TypeRef<T> typeRef, BodyAdapter.Hints hints) ForwardingEncoder.toBody(T value, TypeRef<T> typeRef, BodyAdapter.Hints hints) default <T> HttpResponse.BodySubscriber<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.default <T> HttpResponse.BodySubscriber<Supplier<T>> AbstractBodyAdapter.BaseDecoder.toDeferredObject(TypeRef<T> typeRef, BodyAdapter.Hints hints) Returns a completedHttpResponse.BodySubscriberthat lazily decodes the response body into an object of the given type using the givenBodyAdapter.Hints.<T> HttpResponse.BodySubscriber<Supplier<T>> ForwardingDecoder.toDeferredObject(TypeRef<T> typeRef, @Nullable MediaType mediaType) <T> HttpResponse.BodySubscriber<Supplier<T>> ForwardingDecoder.toDeferredObject(TypeRef<T> typeRef, BodyAdapter.Hints hints) default <T> HttpResponse.BodySubscriber<T> Returns aHttpResponse.BodySubscriberthat decodes the response body into an object of the given type using the format specified by the given media type.<T> HttpResponse.BodySubscriber<T> AbstractBodyAdapter.BaseDecoder.toObject(TypeRef<T> typeRef, BodyAdapter.Hints hints) <T> HttpResponse.BodySubscriber<T> <T> HttpResponse.BodySubscriber<T> ForwardingDecoder.toObject(TypeRef<T> typeRef, BodyAdapter.Hints hints)
TypeRef.of(Class)