@@ -0,0 +1,1724 @@
+package io.reactivesw.catalog.producttype.domain.service.update;%0A%0Aimport io.reactivesw.catalog.product.application.model.attributes.LocalizedEnumAttributeType;%0Aimport io.reactivesw.catalog.producttype.application.model.action.SetLocalizedEnumValueLabel;%0Aimport io.reactivesw.catalog.producttype.domain.entity.ProductTypeEntity;%0Aimport io.reactivesw.catalog.producttype.infrastructure.util.ProductTypeActionUtils;%0Aimport io.reactivesw.common.model.Update;%0Aimport io.reactivesw.common.model.UpdateAction;%0A%0Aimport org.springframework.stereotype.Service;%0A%0A/**%0A * Created by Davis on 17/1/3.%0A */%0A@Service(value = ProductTypeActionUtils.SET_LOCALIZED_ENUM_VALUE_LABEL)%0Apublic class SetLocalizedEnumValueLabelService implements Update%3CProductTypeEntity%3E %7B%0A%0A  /**%0A   * set enum value label.%0A   * @param entity E%0A   * @param action UpdateAction%0A   */%0A  @Override%0A  public void handle(ProductTypeEntity entity, UpdateAction action) %7B%0A    if (entity.getAttributes() == null %7C%7C entity.getAttributes().isEmpty()) %7B%0A      return;%0A    %7D%0A    SetLocalizedEnumValueLabel setPlainEnumValueLabel = (SetLocalizedEnumValueLabel) action;%0A    entity.getAttributes().forEach(%0A        attribute -%3E %7B%0A          if (attribute.getName().equals(setPlainEnumValueLabel.getAttributeName())%0A              && attribute.getType() instanceof SetLocalizedEnumValueLabel)%7B%0A              ((LocalizedEnumAttributeType) attribute.getType()).getValues().forEach(%0A                  type -%3E %7B%0A                    if (type.getKey().equals(setPlainEnumValueLabel.getNewValue().getKey())) %7B%0A                      type.setLabel(setPlainEnumValueLabel.getNewValue().getLabel());%0A                    %7D%0A                  %7D%0A              );%0A          %7D%0A        %7D%0A    );%0A  %7D%0A%7D%0A

set localized enum value label for product type