001 002package com.commercetools.api.models.product_discount; 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 * ProductDiscountUpdate 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class ProductDiscountUpdateImpl implements ProductDiscountUpdate, ModelBase { 022 023 private Long version; 024 025 private java.util.List<com.commercetools.api.models.product_discount.ProductDiscountUpdateAction> actions; 026 027 /** 028 * create instance with all properties 029 */ 030 @JsonCreator 031 ProductDiscountUpdateImpl(@JsonProperty("version") final Long version, 032 @JsonProperty("actions") final java.util.List<com.commercetools.api.models.product_discount.ProductDiscountUpdateAction> actions) { 033 this.version = version; 034 this.actions = actions; 035 } 036 037 /** 038 * create empty instance 039 */ 040 public ProductDiscountUpdateImpl() { 041 } 042 043 /** 044 * <p>Expected version of the ProductDiscount on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error is returned.</p> 045 */ 046 047 public Long getVersion() { 048 return this.version; 049 } 050 051 /** 052 * <p>Update actions to be performed on the ProductDiscount.</p> 053 */ 054 055 public java.util.List<com.commercetools.api.models.product_discount.ProductDiscountUpdateAction> getActions() { 056 return this.actions; 057 } 058 059 public void setVersion(final Long version) { 060 this.version = version; 061 } 062 063 public void setActions(final com.commercetools.api.models.product_discount.ProductDiscountUpdateAction... actions) { 064 this.actions = new ArrayList<>(Arrays.asList(actions)); 065 } 066 067 public void setActions( 068 final java.util.List<com.commercetools.api.models.product_discount.ProductDiscountUpdateAction> actions) { 069 this.actions = actions; 070 } 071 072 @Override 073 public boolean equals(Object o) { 074 if (this == o) 075 return true; 076 077 if (o == null || getClass() != o.getClass()) 078 return false; 079 080 ProductDiscountUpdateImpl that = (ProductDiscountUpdateImpl) o; 081 082 return new EqualsBuilder().append(version, that.version).append(actions, that.actions).isEquals(); 083 } 084 085 @Override 086 public int hashCode() { 087 return new HashCodeBuilder(17, 37).append(version).append(actions).toHashCode(); 088 } 089 090}