public final class SyncSingleLocale
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static io.sphere.sdk.products.ProductDraft |
filterFrenchLocales(io.sphere.sdk.products.ProductDraft productDraft)
Takes a
ProductDraft and filters out any localization other than Locale.FRENCH
from LocalizedString fields of the supplied ProductDraft . |
static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product>> |
syncFrenchDataOnly(java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product>> updateActions,
io.sphere.sdk.products.ProductDraft newProductDraft,
io.sphere.sdk.products.ProductProjection oldProduct)
Takes in a
List of product update actions that was built from comparing a newProductDraft and an oldProduct and maps the update actions so that only
localizations with value Locale.FRENCH are synced and all the other locales are left
untouched. |
@Nonnull public static java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product>> syncFrenchDataOnly(@Nonnull java.util.List<io.sphere.sdk.commands.UpdateAction<io.sphere.sdk.products.Product>> updateActions, @Nonnull io.sphere.sdk.products.ProductDraft newProductDraft, @Nonnull io.sphere.sdk.products.ProductProjection oldProduct)
List
of product update actions that was built from comparing a newProductDraft
and an oldProduct
and maps the update actions so that only
localizations with value Locale.FRENCH
are synced and all the other locales are left
untouched.updateActions
- the update actions built from comparing newProductDraft
and oldProduct
.newProductDraft
- the new ProductDraft
being synced.oldProduct
- the old existing Product
.@Nonnull public static io.sphere.sdk.products.ProductDraft filterFrenchLocales(@Nonnull io.sphere.sdk.products.ProductDraft productDraft)
ProductDraft
and filters out any localization other than Locale.FRENCH
from LocalizedString
fields of the supplied ProductDraft
. Note: This method
will only filter the LocalizedString
fields on the ProductDraft
level, so it
will not filter out LocalizedString
fields on the variant level.productDraft
- the product draft to filter the localizations from.LocalizedString
fields that have only entries of the
Locale.FRENCH
locale.