public final class StateReferenceResolutionUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<io.sphere.sdk.states.StateDraft> |
mapToStateDrafts(java.util.List<io.sphere.sdk.states.State> states,
ReferenceIdToKeyCache referenceIdToKeyCache)
Returns an
List<StateDraft> consisting of the results of applying the
mapping from State to StateDraft with considering reference resolution. |
@Nonnull
public static java.util.List<io.sphere.sdk.states.StateDraft> mapToStateDrafts(@Nonnull
java.util.List<io.sphere.sdk.states.State> states,
@Nonnull
ReferenceIdToKeyCache referenceIdToKeyCache)
List<StateDraft> consisting of the results of applying the
mapping from State to StateDraft with considering reference resolution.
| Reference field | from | to |
|---|---|---|
| transitions | Set<Reference<State>> |
Set<Reference<State>> (with key replaced with id field) |
Note: The transition references should be cached(idToKey value fetched and stored in a map). Any reference, which have its id in place and not replaced by the key, it would not be found in the map. In this case, this reference will be considered as existing resources on the target commercetools project and the library will issues an update/create API request without reference resolution..
states - the states without expansion of references.referenceIdToKeyCache - the instance that manages cache.List of StateDraft built from the supplied List of State.