Class FutureResult<T>
java.lang.Object
org.springframework.data.redis.connection.FutureResult<T>
- Type Parameters:
- T- The data type of the object that holds the future result (usually type of the- Futureor response wrapper).
The result of an asynchronous operation
- Author:
- Jennifer Hickey, Christoph Strobl, Mark Paluch
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionFutureResult(T resultHolder) Create newFutureResultfor given object actually holding the result itself.FutureResult(T resultHolder, Converter converter) Create newFutureResultfor given object actually holding the result itself and a converter capable of transforming the result viaconvert(Object).FutureResult(T resultHolder, Converter converter, Supplier<?> defaultConversionResult) Create newFutureResultfor given object actually holding the result itself and a converter capable of transforming the result viaconvert(Object).
- 
Method SummaryModifier and TypeMethodDescriptionabstract booleanIndicate whether or not the actual result needs to beconvertedbefore handing over.Converts the given result if a converter is specified, else returns the resultabstract Objectget()Get the object holding the actual result.booleanisStatus()Indicates if this result is the status of an operation.voidsetStatus(boolean status) Indicates if this result is the status of an operation.
- 
Field Details- 
converter
 
- 
- 
Constructor Details- 
FutureResultCreate newFutureResultfor given object actually holding the result itself.- Parameters:
- resultHolder- must not be null.
 
- 
FutureResultCreate newFutureResultfor given object actually holding the result itself and a converter capable of transforming the result viaconvert(Object).- Parameters:
- resultHolder- must not be null.
- converter- can be null and will be defaulted to an identity converter- value -> valueto preserve the original value.
 
- 
FutureResultpublic FutureResult(T resultHolder, @Nullable Converter converter, Supplier<?> defaultConversionResult) Create newFutureResultfor given object actually holding the result itself and a converter capable of transforming the result viaconvert(Object).- Parameters:
- resultHolder- must not be null.
- converter- can be null and will be defaulted to an identity converter- value -> valueto preserve the original value.
- defaultConversionResult- must not be null.
- Since:
- 2.1
 
 
- 
- 
Method Details- 
getResultHolderGet the object holding the actual result.- Returns:
- never null.
- Since:
- 1.1
 
- 
convertConverts the given result if a converter is specified, else returns the result- Parameters:
- result- The result to convert. Can be null.
- Returns:
- The converted result or null.
 
- 
getConverter
- 
isStatuspublic boolean isStatus()Indicates if this result is the status of an operation. Typically status results will be discarded on conversion.- Returns:
- true if this is a status result (i.e. OK)
 
- 
setStatuspublic void setStatus(boolean status) Indicates if this result is the status of an operation. Typically status results will be discarded on conversion.
- 
get- Returns:
- The result of the operation. Can be null.
 
- 
conversionRequiredpublic abstract boolean conversionRequired()Indicate whether or not the actual result needs to beconvertedbefore handing over.- Returns:
- true if result conversion is required.
- Since:
- 2.1
 
 
-