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 to Category update action.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class AddToCategoryChangeImpl implements AddToCategoryChange, ModelBase { 022 023 private String type; 024 025 private String change; 026 027 private java.util.List<com.commercetools.history.models.common.Reference> previousValue; 028 029 private java.util.List<com.commercetools.history.models.common.Reference> nextValue; 030 031 private com.commercetools.history.models.common.Reference category; 032 033 /** 034 * create instance with all properties 035 */ 036 @JsonCreator 037 AddToCategoryChangeImpl(@JsonProperty("change") final String change, 038 @JsonProperty("previousValue") final java.util.List<com.commercetools.history.models.common.Reference> previousValue, 039 @JsonProperty("nextValue") final java.util.List<com.commercetools.history.models.common.Reference> nextValue, 040 @JsonProperty("category") final com.commercetools.history.models.common.Reference category) { 041 this.change = change; 042 this.previousValue = previousValue; 043 this.nextValue = nextValue; 044 this.category = category; 045 this.type = ADD_TO_CATEGORY_CHANGE; 046 } 047 048 /** 049 * create empty instance 050 */ 051 public AddToCategoryChangeImpl() { 052 this.type = ADD_TO_CATEGORY_CHANGE; 053 } 054 055 /** 056 * 057 */ 058 059 public String getType() { 060 return this.type; 061 } 062 063 /** 064 * 065 */ 066 067 public String getChange() { 068 return this.change; 069 } 070 071 /** 072 * <p>Value before the change.</p> 073 */ 074 075 public java.util.List<com.commercetools.history.models.common.Reference> getPreviousValue() { 076 return this.previousValue; 077 } 078 079 /** 080 * <p>Value after the change.</p> 081 */ 082 083 public java.util.List<com.commercetools.history.models.common.Reference> getNextValue() { 084 return this.nextValue; 085 } 086 087 /** 088 * <p>Category to which the Product was added.</p> 089 */ 090 091 public com.commercetools.history.models.common.Reference getCategory() { 092 return this.category; 093 } 094 095 public void setChange(final String change) { 096 this.change = change; 097 } 098 099 public void setPreviousValue(final com.commercetools.history.models.common.Reference... previousValue) { 100 this.previousValue = new ArrayList<>(Arrays.asList(previousValue)); 101 } 102 103 public void setPreviousValue( 104 final java.util.List<com.commercetools.history.models.common.Reference> previousValue) { 105 this.previousValue = previousValue; 106 } 107 108 public void setNextValue(final com.commercetools.history.models.common.Reference... nextValue) { 109 this.nextValue = new ArrayList<>(Arrays.asList(nextValue)); 110 } 111 112 public void setNextValue(final java.util.List<com.commercetools.history.models.common.Reference> nextValue) { 113 this.nextValue = nextValue; 114 } 115 116 public void setCategory(final com.commercetools.history.models.common.Reference category) { 117 this.category = category; 118 } 119 120 @Override 121 public boolean equals(Object o) { 122 if (this == o) 123 return true; 124 125 if (o == null || getClass() != o.getClass()) 126 return false; 127 128 AddToCategoryChangeImpl that = (AddToCategoryChangeImpl) o; 129 130 return new EqualsBuilder().append(type, that.type) 131 .append(change, that.change) 132 .append(previousValue, that.previousValue) 133 .append(nextValue, that.nextValue) 134 .append(category, that.category) 135 .append(type, that.type) 136 .append(change, that.change) 137 .append(previousValue, that.previousValue) 138 .append(nextValue, that.nextValue) 139 .append(category, that.category) 140 .isEquals(); 141 } 142 143 @Override 144 public int hashCode() { 145 return new HashCodeBuilder(17, 37).append(type) 146 .append(change) 147 .append(previousValue) 148 .append(nextValue) 149 .append(category) 150 .toHashCode(); 151 } 152 153}