public final class CommonTypeUpdateActionUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends io.sphere.sdk.models.ResourceIdentifier,S extends io.sphere.sdk.models.ResourceIdentifier> |
areResourceIdentifiersEqual(T oldResourceIdentifier,
S newResourceIdentifier)
Compares the ids of two objects that are of type
ResourceIdentifier (or a type that extends it). |
static <T,S,U extends io.sphere.sdk.commands.UpdateAction<T>> |
buildUpdateAction(S oldObject,
S newObject,
java.util.function.Supplier<U> updateActionSupplier)
Compares two
Object and returns a supplied UpdateAction as a result in an
Optional. |
static <T,S extends io.sphere.sdk.models.ResourceIdentifier,U extends io.sphere.sdk.models.ResourceIdentifier,V extends io.sphere.sdk.commands.UpdateAction<T>> |
buildUpdateActionForReferences(S oldResourceIdentifier,
U newResourceIdentifier,
java.util.function.Supplier<V> updateActionSupplier)
Compares two objects that are of type
ResourceIdentifier (or a type that extends it) and returns a
supplied UpdateAction as a result in an Optional. |
static <T,S,U extends io.sphere.sdk.commands.UpdateAction<T>> |
buildUpdateActions(S oldObject,
S newObject,
java.util.function.Supplier<java.util.List<U>> updateActionSupplier)
Compares two
Object and returns a supplied list of UpdateAction as a result. |
@Nonnull
public static <T,S,U extends io.sphere.sdk.commands.UpdateAction<T>> java.util.Optional<U> buildUpdateAction(@Nullable
S oldObject,
@Nullable
S newObject,
@Nonnull
java.util.function.Supplier<U> updateActionSupplier)
Object and returns a supplied UpdateAction as a result in an
Optional. If both the Objects have the same values, then no update action is needed and hence an
empty Optional is returned.T - the type of the UpdateActionS - the type of the objects to compareU - certain UpdateAction implementation typeoldObject - the object which should be updatednewObject - the object with the new informationupdateActionSupplier - the supplier that returns the update action to return in the optional@Nonnull
public static <T,S extends io.sphere.sdk.models.ResourceIdentifier,U extends io.sphere.sdk.models.ResourceIdentifier,V extends io.sphere.sdk.commands.UpdateAction<T>> java.util.Optional<V> buildUpdateActionForReferences(@Nullable
S oldResourceIdentifier,
@Nullable
U newResourceIdentifier,
@Nonnull
java.util.function.Supplier<V> updateActionSupplier)
ResourceIdentifier (or a type that extends it) and returns a
supplied UpdateAction as a result in an Optional. If both the Objects have the same
values, then no update action is needed and hence an empty Optional is returned.T - the type of the UpdateActionS - the type of the old resource identifierU - the type of the new resource identifierV - concrete UpdateAction implementation typeoldResourceIdentifier - the old resource identifiernewResourceIdentifier - the new resource identifierupdateActionSupplier - the supplier that returns the update action to return in the optionalpublic static <T extends io.sphere.sdk.models.ResourceIdentifier,S extends io.sphere.sdk.models.ResourceIdentifier> boolean areResourceIdentifiersEqual(@Nullable
T oldResourceIdentifier,
@Nullable
S newResourceIdentifier)
ResourceIdentifier (or a type that extends it).T - the type of the old resource identifierS - the type of the new resource identifieroldResourceIdentifier - the old resource identifiernewResourceIdentifier - the new resource identifier@Nonnull
public static <T,S,U extends io.sphere.sdk.commands.UpdateAction<T>> java.util.List<U> buildUpdateActions(@Nullable
S oldObject,
@Nullable
S newObject,
@Nonnull
java.util.function.Supplier<java.util.List<U>> updateActionSupplier)
Object and returns a supplied list of UpdateAction as a result.
If both the Objects have the same values, then no update action is needed
and hence an empty list is returned.T - the type of the UpdateActionS - the type of the objects to compareU - certain UpdateAction implementation typeoldObject - the object which should be updatednewObject - the object with the new informationupdateActionSupplier - the supplier that returns a list of update actions if the objects are different