001 002package com.commercetools.history.models.change; 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 * <p>Change triggered by the Add Product update action.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class AddProductChangeImpl implements AddProductChange, ModelBase { 022 023 private String type; 024 025 private String change; 026 027 private com.commercetools.history.models.common.Reference nextValue; 028 029 private com.commercetools.history.models.common.ProductVariantSelection variantSelection; 030 031 /** 032 * create instance with all properties 033 */ 034 @JsonCreator 035 AddProductChangeImpl(@JsonProperty("change") final String change, 036 @JsonProperty("nextValue") final com.commercetools.history.models.common.Reference nextValue, 037 @JsonProperty("variantSelection") final com.commercetools.history.models.common.ProductVariantSelection variantSelection) { 038 this.change = change; 039 this.nextValue = nextValue; 040 this.variantSelection = variantSelection; 041 this.type = ADD_PRODUCT_CHANGE; 042 } 043 044 /** 045 * create empty instance 046 */ 047 public AddProductChangeImpl() { 048 this.type = ADD_PRODUCT_CHANGE; 049 } 050 051 /** 052 * 053 */ 054 055 public String getType() { 056 return this.type; 057 } 058 059 /** 060 * 061 */ 062 063 public String getChange() { 064 return this.change; 065 } 066 067 /** 068 * <p>Value after the change.</p> 069 */ 070 071 public com.commercetools.history.models.common.Reference getNextValue() { 072 return this.nextValue; 073 } 074 075 /** 076 * <p>The Product Variants included in the Product Selection.</p> 077 */ 078 079 public com.commercetools.history.models.common.ProductVariantSelection getVariantSelection() { 080 return this.variantSelection; 081 } 082 083 public void setChange(final String change) { 084 this.change = change; 085 } 086 087 public void setNextValue(final com.commercetools.history.models.common.Reference nextValue) { 088 this.nextValue = nextValue; 089 } 090 091 public void setVariantSelection( 092 final com.commercetools.history.models.common.ProductVariantSelection variantSelection) { 093 this.variantSelection = variantSelection; 094 } 095 096 @Override 097 public boolean equals(Object o) { 098 if (this == o) 099 return true; 100 101 if (o == null || getClass() != o.getClass()) 102 return false; 103 104 AddProductChangeImpl that = (AddProductChangeImpl) o; 105 106 return new EqualsBuilder().append(type, that.type) 107 .append(change, that.change) 108 .append(nextValue, that.nextValue) 109 .append(variantSelection, that.variantSelection) 110 .append(type, that.type) 111 .append(change, that.change) 112 .append(nextValue, that.nextValue) 113 .append(variantSelection, that.variantSelection) 114 .isEquals(); 115 } 116 117 @Override 118 public int hashCode() { 119 return new HashCodeBuilder(17, 37).append(type) 120 .append(change) 121 .append(nextValue) 122 .append(variantSelection) 123 .toHashCode(); 124 } 125 126}