S - a subclass implementation of BaseSyncOptions that is used to allow/deny some specific options,
specified by the user, on reference resolution.public abstract class BaseReferenceResolver<T,S extends BaseSyncOptions>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BLANK_ID_VALUE_ON_RESOURCE_IDENTIFIER |
protected S |
options |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseReferenceResolver(S options) |
| Modifier and Type | Method and Description |
|---|---|
protected static java.lang.String |
getKeyFromResourceIdentifier(io.sphere.sdk.models.ResourceIdentifier resourceIdentifier)
This method fetches the id value on the passed
ResourceIdentifier, if valid. |
abstract java.util.concurrent.CompletionStage<T> |
resolveReferences(T draft)
Given a draft this method attempts to resolve the all the references on the draft to
return a
CompletionStage which contains a new instance of the draft with the resolved
references. |
public static final java.lang.String BLANK_ID_VALUE_ON_RESOURCE_IDENTIFIER
protected S extends BaseSyncOptions options
protected BaseReferenceResolver(@Nonnull
S options)
public abstract java.util.concurrent.CompletionStage<T> resolveReferences(@Nonnull T draft)
CompletionStage which contains a new instance of the draft with the resolved
references. The keys of the references are either taken from the expanded references or
taken from the id field of the references.draft - the productDraft to resolve it's references.CompletionStage that contains as a result a new draft instance with resolved references
or, in case an error occurs during reference resolution, a ReferenceResolutionException.@Nonnull
protected static java.lang.String getKeyFromResourceIdentifier(@Nonnull
io.sphere.sdk.models.ResourceIdentifier resourceIdentifier)
throws ReferenceResolutionException
ResourceIdentifier, if valid. If it is not valid, a
ReferenceResolutionException will be thrown. The validity checks are:
ReferenceResolutionException is thrown.resourceIdentifier - the reference from which the key value is validated and returned.ResourceIdentifierReferenceResolutionException - if any of the validation checks fail.