public class ComposedComputationIdentifier<ResultType extends ComputeResult> extends Object implements ComputationIdentifier<ComposedResult<ComputeKey<ResultType>,ResultType>>
ComputationIdentifier
for a composed GraphComputation
A ComposedComputationIdentifier
is a pair of ClassBasedComputationIdentifier
called the base identifier and a class of ResultType
, which maps to a composed
computation that takes the result of the GraphComputation
of the base identifier and uses it
to compute a result of ResultType
.
e.g. a ComposedComputationIdentifer.of(Key1.IDENTIFIER, Result2.class)
identifies the
composed computation of a base computation that computes Key1
to Result1
, then
uses Key1
and Result1
to compute Result2
.
The ComposedComputationIdentifier
is only identified by the base computation it starts
with and the end ResultType
. It does not matter what ComputationIdentifier
s are
chained in the middle of getting from the base computation to the target result.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Class<ComposedResult<ComputeKey<ResultType>,ResultType>> |
getResultTypeClass() |
Class<ResultType> |
getTargetResultClass() |
int |
hashCode() |
static <ResultType extends ComputeResult> |
of(ClassBasedComputationIdentifier<?> originIdentifier,
Class<ResultType> targetClass) |
static <ResultType extends ComputeResult> |
of(ComposedComputationIdentifier<?> originIdentifier,
Class<ResultType> targetClass) |
static <ResultType extends ComputeResult> |
of(ComputationIdentifier<?> originIdentifier,
Class<ResultType> targetClass)
Delegates appropriate to one of the above
of(ClassBasedComputationIdentifier, Class)
or of(ComposedComputationIdentifier, Class) |
String |
toString() |
public static <ResultType extends ComputeResult> ComposedComputationIdentifier<ResultType> of(ClassBasedComputationIdentifier<?> originIdentifier, Class<ResultType> targetClass)
ResultType
- the type of the result returned by the computation of this ComputationIdentifier
originIdentifier
- the original ClassBasedComputationIdentifier
that starts off a
chain of compositiontargetClass
- the class of the result type of the computation that this ComputationIdentifier
identifiesComposedComputationIdentifier
that represents the computation that given the
key of the computation of the base identifier and returns the final resultpublic static <ResultType extends ComputeResult> ComposedComputationIdentifier<ResultType> of(ComposedComputationIdentifier<?> originIdentifier, Class<ResultType> targetClass)
ResultType
- the type of the result that th computation that this ComputationIdentifier
returnsoriginIdentifier
- the ComposedComputationIdentifier
that this ComposedComputationIdentifier
is based off of. The supplied base computation is unwrapped
to the base computation it storestargetClass
- the class of the result type of the computation that this ComputationIdentifier
identifiesComposedComputationIdentifier
that represents the computation that starts at
the base identifier and returns the final resultpublic static <ResultType extends ComputeResult> ComposedComputationIdentifier<ResultType> of(ComputationIdentifier<?> originIdentifier, Class<ResultType> targetClass)
of(ClassBasedComputationIdentifier, Class)
or of(ComposedComputationIdentifier, Class)
public Class<ComposedResult<ComputeKey<ResultType>,ResultType>> getResultTypeClass()
getResultTypeClass
in interface ComputationIdentifier<ComposedResult<ComputeKey<ResultType extends ComputeResult>,ResultType extends ComputeResult>>
GraphComputation
public Class<ResultType> getTargetResultClass()
ResultType
contained in the ComposedResult
of the
computation that this identifier maps to.