All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.commercetools.history.models.change.SetOrderLineItemCustomFieldChange Maven / Gradle / Ivy

There is a newer version: 17.15.1
Show newest version

package com.commercetools.history.models.change;

import java.time.*;
import java.util.*;
import java.util.function.Function;

import javax.annotation.Nullable;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import com.commercetools.history.models.common.LocalizedString;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;

import io.vrap.rmf.base.client.utils.Generated;

/**
 *  

Change triggered by the following update actions:

*
    *
  • Set LineItem CustomField on Orders.
  • *
  • Set LineItem CustomField on Staged Orders.
  • *
* *
* Example to create an instance using the builder pattern *
*

 *     SetOrderLineItemCustomFieldChange setOrderLineItemCustomFieldChange = SetOrderLineItemCustomFieldChange.builder()
 *             .change("{change}")
 *             .customTypeId("{customTypeId}")
 *             .name("{name}")
 *             .lineItem(lineItemBuilder -> lineItemBuilder)
 *             .variant("{variant}")
 *             .build()
 * 
*
*/ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") @JsonDeserialize(as = SetOrderLineItemCustomFieldChangeImpl.class) public interface SetOrderLineItemCustomFieldChange extends Change { /** * discriminator value for SetOrderLineItemCustomFieldChange */ String SET_ORDER_LINE_ITEM_CUSTOM_FIELD_CHANGE = "SetOrderLineItemCustomFieldChange"; /** * * @return type */ @NotNull @JsonProperty("type") public String getType(); /** * * @return change */ @NotNull @JsonProperty("change") public String getChange(); /** *

Value before the change.

* @return previousValue */ @NotNull @JsonProperty("previousValue") public Object getPreviousValue(); /** *

Value after the change.

* @return nextValue */ @NotNull @JsonProperty("nextValue") public Object getNextValue(); /** *

id of the referenced Type.

* @return customTypeId */ @NotNull @JsonProperty("customTypeId") public String getCustomTypeId(); /** *

Name of the Custom Field.

* @return name */ @NotNull @JsonProperty("name") public String getName(); /** *

Name of the Product the Line Item is based on.

* @return lineItem */ @NotNull @Valid @JsonProperty("lineItem") public LocalizedString getLineItem(); /** *

sku or key of the ProductVariant.

* @return variant */ @NotNull @JsonProperty("variant") public String getVariant(); /** * set change * @param change value to be set */ public void setChange(final String change); /** *

Value before the change.

* @param previousValue value to be set */ public void setPreviousValue(final Object previousValue); /** *

Value after the change.

* @param nextValue value to be set */ public void setNextValue(final Object nextValue); /** *

id of the referenced Type.

* @param customTypeId value to be set */ public void setCustomTypeId(final String customTypeId); /** *

Name of the Custom Field.

* @param name value to be set */ public void setName(final String name); /** *

Name of the Product the Line Item is based on.

* @param lineItem value to be set */ public void setLineItem(final LocalizedString lineItem); /** *

sku or key of the ProductVariant.

* @param variant value to be set */ public void setVariant(final String variant); /** * factory method * @return instance of SetOrderLineItemCustomFieldChange */ public static SetOrderLineItemCustomFieldChange of() { return new SetOrderLineItemCustomFieldChangeImpl(); } /** * factory method to create a shallow copy SetOrderLineItemCustomFieldChange * @param template instance to be copied * @return copy instance */ public static SetOrderLineItemCustomFieldChange of(final SetOrderLineItemCustomFieldChange template) { SetOrderLineItemCustomFieldChangeImpl instance = new SetOrderLineItemCustomFieldChangeImpl(); instance.setChange(template.getChange()); instance.setPreviousValue(template.getPreviousValue()); instance.setNextValue(template.getNextValue()); instance.setCustomTypeId(template.getCustomTypeId()); instance.setName(template.getName()); instance.setLineItem(template.getLineItem()); instance.setVariant(template.getVariant()); return instance; } /** * factory method to create a deep copy of SetOrderLineItemCustomFieldChange * @param template instance to be copied * @return copy instance */ @Nullable public static SetOrderLineItemCustomFieldChange deepCopy( @Nullable final SetOrderLineItemCustomFieldChange template) { if (template == null) { return null; } SetOrderLineItemCustomFieldChangeImpl instance = new SetOrderLineItemCustomFieldChangeImpl(); instance.setChange(template.getChange()); instance.setPreviousValue(template.getPreviousValue()); instance.setNextValue(template.getNextValue()); instance.setCustomTypeId(template.getCustomTypeId()); instance.setName(template.getName()); instance.setLineItem(com.commercetools.history.models.common.LocalizedString.deepCopy(template.getLineItem())); instance.setVariant(template.getVariant()); return instance; } /** * builder factory method for SetOrderLineItemCustomFieldChange * @return builder */ public static SetOrderLineItemCustomFieldChangeBuilder builder() { return SetOrderLineItemCustomFieldChangeBuilder.of(); } /** * create builder for SetOrderLineItemCustomFieldChange instance * @param template instance with prefilled values for the builder * @return builder */ public static SetOrderLineItemCustomFieldChangeBuilder builder(final SetOrderLineItemCustomFieldChange template) { return SetOrderLineItemCustomFieldChangeBuilder.of(template); } /** * accessor map function * @param mapped type * @param helper function to map the object * @return mapped value */ default T withSetOrderLineItemCustomFieldChange(Function helper) { return helper.apply(this); } /** * gives a TypeReference for usage with Jackson DataBind * @return TypeReference */ public static com.fasterxml.jackson.core.type.TypeReference typeReference() { return new com.fasterxml.jackson.core.type.TypeReference() { @Override public String toString() { return "TypeReference"; } }; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy