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. |
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.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
Copyright © 2010–2020. All rights reserved.