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 automatically when an InventoryEntry associated with a Product changes.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class SetVariantAvailabilityChangeImpl implements SetVariantAvailabilityChange, ModelBase { 022 023 private String type; 024 025 private String change; 026 027 private com.commercetools.history.models.common.ProductVariantAvailability previousValue; 028 029 private com.commercetools.history.models.common.ProductVariantAvailability nextValue; 030 031 private String catalogData; 032 033 private String variant; 034 035 /** 036 * create instance with all properties 037 */ 038 @JsonCreator 039 SetVariantAvailabilityChangeImpl(@JsonProperty("change") final String change, 040 @JsonProperty("previousValue") final com.commercetools.history.models.common.ProductVariantAvailability previousValue, 041 @JsonProperty("nextValue") final com.commercetools.history.models.common.ProductVariantAvailability nextValue, 042 @JsonProperty("catalogData") final String catalogData, @JsonProperty("variant") final String variant) { 043 this.change = change; 044 this.previousValue = previousValue; 045 this.nextValue = nextValue; 046 this.catalogData = catalogData; 047 this.variant = variant; 048 this.type = SET_VARIANT_AVAILABILITY_CHANGE; 049 } 050 051 /** 052 * create empty instance 053 */ 054 public SetVariantAvailabilityChangeImpl() { 055 this.type = SET_VARIANT_AVAILABILITY_CHANGE; 056 } 057 058 /** 059 * 060 */ 061 062 public String getType() { 063 return this.type; 064 } 065 066 /** 067 * 068 */ 069 070 public String getChange() { 071 return this.change; 072 } 073 074 /** 075 * <p>Value before the change.</p> 076 */ 077 078 public com.commercetools.history.models.common.ProductVariantAvailability getPreviousValue() { 079 return this.previousValue; 080 } 081 082 /** 083 * <p>Value after the change.</p> 084 */ 085 086 public com.commercetools.history.models.common.ProductVariantAvailability getNextValue() { 087 return this.nextValue; 088 } 089 090 /** 091 * <ul> 092 * <li><code>staged</code>, if the staged ProductCatalogData was updated.</li> 093 * <li><code>current</code>, if the current ProductCatalogData was updated.</li> 094 * </ul> 095 */ 096 097 public String getCatalogData() { 098 return this.catalogData; 099 } 100 101 /** 102 * <p><code>sku</code> or <code>key</code> of the ProductVariant.</p> 103 */ 104 105 public String getVariant() { 106 return this.variant; 107 } 108 109 public void setChange(final String change) { 110 this.change = change; 111 } 112 113 public void setPreviousValue( 114 final com.commercetools.history.models.common.ProductVariantAvailability previousValue) { 115 this.previousValue = previousValue; 116 } 117 118 public void setNextValue(final com.commercetools.history.models.common.ProductVariantAvailability nextValue) { 119 this.nextValue = nextValue; 120 } 121 122 public void setCatalogData(final String catalogData) { 123 this.catalogData = catalogData; 124 } 125 126 public void setVariant(final String variant) { 127 this.variant = variant; 128 } 129 130 @Override 131 public boolean equals(Object o) { 132 if (this == o) 133 return true; 134 135 if (o == null || getClass() != o.getClass()) 136 return false; 137 138 SetVariantAvailabilityChangeImpl that = (SetVariantAvailabilityChangeImpl) o; 139 140 return new EqualsBuilder().append(type, that.type) 141 .append(change, that.change) 142 .append(previousValue, that.previousValue) 143 .append(nextValue, that.nextValue) 144 .append(catalogData, that.catalogData) 145 .append(variant, that.variant) 146 .append(type, that.type) 147 .append(change, that.change) 148 .append(previousValue, that.previousValue) 149 .append(nextValue, that.nextValue) 150 .append(catalogData, that.catalogData) 151 .append(variant, that.variant) 152 .isEquals(); 153 } 154 155 @Override 156 public int hashCode() { 157 return new HashCodeBuilder(17, 37).append(type) 158 .append(change) 159 .append(previousValue) 160 .append(nextValue) 161 .append(catalogData) 162 .append(variant) 163 .toHashCode(); 164 } 165 166}