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