public abstract class ResponseTypes extends Object
ResponseType
.Modifier and Type | Method and Description |
---|---|
static <R> ResponseType<R> |
instanceOf(Class<R> type)
Specify the desire to retrieve a single instance of type
R when performing a query. |
static <R> ResponseType<List<R>> |
multipleInstancesOf(Class<R> type)
Specify the desire to retrieve a collection of instances of type
R when performing a query. |
static <R> ResponseType<Optional<R>> |
optionalInstanceOf(Class<R> type)
Specify the desire to retrieve an
Optional<R> when performing a query. |
static <R> ResponseType<org.reactivestreams.Publisher<R>> |
publisherOf(Class<R> type)
Specify the desire to retrieve a Publisher (reactive stream) of instances of type
R when performing a
query. |
public static <R> ResponseType<R> instanceOf(Class<R> type)
R
when performing a query.R
- the generic type of the instantiated ResponseType
type
- the R
which is expected to be the response typeResponseType
specifying the desire to retrieve a single instance of type R
public static <R> ResponseType<Optional<R>> optionalInstanceOf(Class<R> type)
Optional<R>
when performing a query.
Note that this ResponseType
will declare the same expectations on the Query Result as the ResponseType
returned by instanceOf(Class)
. The difference is that the result provided by this ResponseType
is wrapped in an Optional
.
R
- the generic type of the instantiated ResponseType
type
- the R
which is expected to be the response typeResponseType
specifying the desire to retrieve an optional instance of type R
public static <R> ResponseType<List<R>> multipleInstancesOf(Class<R> type)
R
when performing a query.
If no handler is found that can retrieve the type as a collection, a handler is selected that returns a single
instance of the provided type.R
- the generic type of the instantiated ResponseType
type
- the R
which is expected to be the response typeResponseType
specifying the desire to retrieve a collection of instances of type R
public static <R> ResponseType<org.reactivestreams.Publisher<R>> publisherOf(Class<R> type)
R
when performing a
query.R
- the generic type of the instantiated ResponseType
type
- the R
which is expected to be the response typeResponseType
specifying the desire to retrieve a publisher of instances of type R
Copyright © 2010–2024. All rights reserved.