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 Set ShoppingListLineItem Custom Type update action.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class SetShoppingListLineItemCustomTypeChangeImpl implements SetShoppingListLineItemCustomTypeChange, ModelBase { 022 023 private String type; 024 025 private String change; 026 027 private com.commercetools.history.models.common.CustomFields previousValue; 028 029 private com.commercetools.history.models.common.CustomFields nextValue; 030 031 private com.commercetools.history.models.change_value.ShoppingListLineItemValue lineItem; 032 033 /** 034 * create instance with all properties 035 */ 036 @JsonCreator 037 SetShoppingListLineItemCustomTypeChangeImpl(@JsonProperty("change") final String change, 038 @JsonProperty("previousValue") final com.commercetools.history.models.common.CustomFields previousValue, 039 @JsonProperty("nextValue") final com.commercetools.history.models.common.CustomFields nextValue, 040 @JsonProperty("lineItem") final com.commercetools.history.models.change_value.ShoppingListLineItemValue lineItem) { 041 this.change = change; 042 this.previousValue = previousValue; 043 this.nextValue = nextValue; 044 this.lineItem = lineItem; 045 this.type = SET_SHOPPING_LIST_LINE_ITEM_CUSTOM_TYPE_CHANGE; 046 } 047 048 /** 049 * create empty instance 050 */ 051 public SetShoppingListLineItemCustomTypeChangeImpl() { 052 this.type = SET_SHOPPING_LIST_LINE_ITEM_CUSTOM_TYPE_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 com.commercetools.history.models.common.CustomFields getPreviousValue() { 076 return this.previousValue; 077 } 078 079 /** 080 * <p>Value after the change.</p> 081 */ 082 083 public com.commercetools.history.models.common.CustomFields getNextValue() { 084 return this.nextValue; 085 } 086 087 /** 088 * <p>Holds information about the updated Shopping List Line Item.</p> 089 */ 090 091 public com.commercetools.history.models.change_value.ShoppingListLineItemValue getLineItem() { 092 return this.lineItem; 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.CustomFields previousValue) { 100 this.previousValue = previousValue; 101 } 102 103 public void setNextValue(final com.commercetools.history.models.common.CustomFields nextValue) { 104 this.nextValue = nextValue; 105 } 106 107 public void setLineItem(final com.commercetools.history.models.change_value.ShoppingListLineItemValue lineItem) { 108 this.lineItem = lineItem; 109 } 110 111 @Override 112 public boolean equals(Object o) { 113 if (this == o) 114 return true; 115 116 if (o == null || getClass() != o.getClass()) 117 return false; 118 119 SetShoppingListLineItemCustomTypeChangeImpl that = (SetShoppingListLineItemCustomTypeChangeImpl) o; 120 121 return new EqualsBuilder().append(type, that.type) 122 .append(change, that.change) 123 .append(previousValue, that.previousValue) 124 .append(nextValue, that.nextValue) 125 .append(lineItem, that.lineItem) 126 .append(type, that.type) 127 .append(change, that.change) 128 .append(previousValue, that.previousValue) 129 .append(nextValue, that.nextValue) 130 .append(lineItem, that.lineItem) 131 .isEquals(); 132 } 133 134 @Override 135 public int hashCode() { 136 return new HashCodeBuilder(17, 37).append(type) 137 .append(change) 138 .append(previousValue) 139 .append(nextValue) 140 .append(lineItem) 141 .toHashCode(); 142 } 143 144}