Class StateBatchValidator

    • Method Detail

      • validateAndCollectReferencedKeys

        public org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<io.sphere.sdk.states.StateDraft>,​java.util.Set<java.lang.String>> validateAndCollectReferencedKeys​(@Nonnull
                                                                                                                                                                                   java.util.List<io.sphere.sdk.states.StateDraft> stateDrafts)
        Given the List<StateDraft> of drafts this method attempts to validate drafts and collect referenced keys from the draft and return an ImmutablePair<Set<StateDraft> ,Set<String>> which contains the Set of valid drafts and referenced state transition keys.

        A valid state draft is one which satisfies the following conditions:

        1. It is not null
        2. It has a key which is not blank (null/empty)
        3. It has no invalid state reference on an transition A valid reference is simply one which has its id field's value not blank (null/empty)
        Specified by:
        validateAndCollectReferencedKeys in class BaseBatchValidator<io.sphere.sdk.states.StateDraft,​StateSyncOptions,​StateSyncStatistics>
        Parameters:
        stateDrafts - the state drafts to validate and collect referenced state transition keys.
        Returns:
        ImmutablePair<Set<ProductTypeDraft>, Set<String>> which contains the Set of valid drafts and referenced product type keys.