001 002package com.commercetools.api.models.cart; 003 004import java.time.*; 005import java.util.*; 006 007import com.fasterxml.jackson.annotation.JsonCreator; 008import com.fasterxml.jackson.annotation.JsonProperty; 009import com.fasterxml.jackson.databind.annotation.*; 010 011import io.vrap.rmf.base.client.ModelBase; 012import io.vrap.rmf.base.client.utils.Generated; 013 014import org.apache.commons.lang3.builder.EqualsBuilder; 015import org.apache.commons.lang3.builder.HashCodeBuilder; 016 017/** 018 * CartChangeCustomLineItemPriceModeAction 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class CartChangeCustomLineItemPriceModeActionImpl implements CartChangeCustomLineItemPriceModeAction, ModelBase { 022 023 private String action; 024 025 private String customLineItemId; 026 027 private String customLineItemKey; 028 029 private com.commercetools.api.models.cart.CustomLineItemPriceMode mode; 030 031 /** 032 * create instance with all properties 033 */ 034 @JsonCreator 035 CartChangeCustomLineItemPriceModeActionImpl(@JsonProperty("customLineItemId") final String customLineItemId, 036 @JsonProperty("customLineItemKey") final String customLineItemKey, 037 @JsonProperty("mode") final com.commercetools.api.models.cart.CustomLineItemPriceMode mode) { 038 this.customLineItemId = customLineItemId; 039 this.customLineItemKey = customLineItemKey; 040 this.mode = mode; 041 this.action = CHANGE_CUSTOM_LINE_ITEM_PRICE_MODE; 042 } 043 044 /** 045 * create empty instance 046 */ 047 public CartChangeCustomLineItemPriceModeActionImpl() { 048 this.action = CHANGE_CUSTOM_LINE_ITEM_PRICE_MODE; 049 } 050 051 /** 052 * 053 */ 054 055 public String getAction() { 056 return this.action; 057 } 058 059 /** 060 * <p><code>id</code> of the CustomLineItem to update. Either <code>customLineItemId</code> or <code>customLineItemKey</code> is required.</p> 061 */ 062 063 public String getCustomLineItemId() { 064 return this.customLineItemId; 065 } 066 067 /** 068 * <p><code>key</code> of the CustomLineItem to update. Either <code>customLineItemId</code> or <code>customLineItemKey</code> is required.</p> 069 */ 070 071 public String getCustomLineItemKey() { 072 return this.customLineItemKey; 073 } 074 075 /** 076 * <p>New value to set. Must not be empty.</p> 077 */ 078 079 public com.commercetools.api.models.cart.CustomLineItemPriceMode getMode() { 080 return this.mode; 081 } 082 083 public void setCustomLineItemId(final String customLineItemId) { 084 this.customLineItemId = customLineItemId; 085 } 086 087 public void setCustomLineItemKey(final String customLineItemKey) { 088 this.customLineItemKey = customLineItemKey; 089 } 090 091 public void setMode(final com.commercetools.api.models.cart.CustomLineItemPriceMode mode) { 092 this.mode = mode; 093 } 094 095 @Override 096 public boolean equals(Object o) { 097 if (this == o) 098 return true; 099 100 if (o == null || getClass() != o.getClass()) 101 return false; 102 103 CartChangeCustomLineItemPriceModeActionImpl that = (CartChangeCustomLineItemPriceModeActionImpl) o; 104 105 return new EqualsBuilder().append(action, that.action) 106 .append(customLineItemId, that.customLineItemId) 107 .append(customLineItemKey, that.customLineItemKey) 108 .append(mode, that.mode) 109 .append(action, that.action) 110 .append(customLineItemId, that.customLineItemId) 111 .append(customLineItemKey, that.customLineItemKey) 112 .append(mode, that.mode) 113 .isEquals(); 114 } 115 116 @Override 117 public int hashCode() { 118 return new HashCodeBuilder(17, 37).append(action) 119 .append(customLineItemId) 120 .append(customLineItemKey) 121 .append(mode) 122 .toHashCode(); 123 } 124 125}