public final class StateReferenceResolver extends BaseReferenceResolver<io.sphere.sdk.states.StateDraft,StateSyncOptions>
BLANK_ID_VALUE_ON_REFERENCE, BLANK_KEY_VALUE_ON_RESOURCE_IDENTIFIER, options| Constructor and Description |
|---|
StateReferenceResolver(StateSyncOptions options,
StateService stateService)
Takes a
StateSyncOptions instance, a StateService to instantiate a StateReferenceResolver instance that could be used to resolve the category drafts in the CTP
project specified in the injected StateSyncOptions instance. |
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletionStage<io.sphere.sdk.states.StateDraft> |
resolveReferences(io.sphere.sdk.states.StateDraft stateDraft)
Given a
StateDraft this method attempts to resolve the transition state references to
return a CompletionStage which contains a new instance of the draft with the resolved
references. |
getIdFromReference, getKeyFromResourceIdentifierpublic StateReferenceResolver(@Nonnull
StateSyncOptions options,
@Nonnull
StateService stateService)
StateSyncOptions instance, a StateService to instantiate a StateReferenceResolver instance that could be used to resolve the category drafts in the CTP
project specified in the injected StateSyncOptions instance.options - the container of all the options of the sync process including the CTP project
client and/or configuration and other sync-specific options.stateService - the service to fetch the states for reference resolution.@Nonnull
public java.util.concurrent.CompletionStage<io.sphere.sdk.states.StateDraft> resolveReferences(@Nonnull
io.sphere.sdk.states.StateDraft stateDraft)
StateDraft this method attempts to resolve the transition state references to
return a CompletionStage which contains a new instance of the draft with the resolved
references. The keys of the references are taken from the id field of the references.resolveReferences in class BaseReferenceResolver<io.sphere.sdk.states.StateDraft,StateSyncOptions>stateDraft - the stateDraft to resolve its references.CompletionStage that contains as a result a new Statedraft instance with
resolved category references or, in case an error occurs during reference resolution, a
ReferenceResolutionException.