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>Transition State on Orders.</li> 021 * <li>Transition State on Staged Orders.</li> 022 * <li>Transition State on Payments.</li> 023 * <li>Transition State on Products.</li> 024 * <li>Transition State on Quotes.</li> 025 * <li>Transition State on Staged Quotes.</li> 026 * <li>Transition State on Quote Requests.</li> 027 * <li>Transition State on Reviews.</li> 028 * <li>Transition State on States.</li> 029 * </ul> 030 */ 031@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 032public class TransitionStateChangeImpl implements TransitionStateChange, ModelBase { 033 034 private String type; 035 036 private String change; 037 038 private com.commercetools.history.models.common.Reference previousValue; 039 040 private com.commercetools.history.models.common.Reference nextValue; 041 042 /** 043 * create instance with all properties 044 */ 045 @JsonCreator 046 TransitionStateChangeImpl(@JsonProperty("change") final String change, 047 @JsonProperty("previousValue") final com.commercetools.history.models.common.Reference previousValue, 048 @JsonProperty("nextValue") final com.commercetools.history.models.common.Reference nextValue) { 049 this.change = change; 050 this.previousValue = previousValue; 051 this.nextValue = nextValue; 052 this.type = TRANSITION_STATE_CHANGE; 053 } 054 055 /** 056 * create empty instance 057 */ 058 public TransitionStateChangeImpl() { 059 this.type = TRANSITION_STATE_CHANGE; 060 } 061 062 /** 063 * 064 */ 065 066 public String getType() { 067 return this.type; 068 } 069 070 /** 071 * 072 */ 073 074 public String getChange() { 075 return this.change; 076 } 077 078 /** 079 * <p>Value before the change.</p> 080 */ 081 082 public com.commercetools.history.models.common.Reference getPreviousValue() { 083 return this.previousValue; 084 } 085 086 /** 087 * <p>Value after the change.</p> 088 */ 089 090 public com.commercetools.history.models.common.Reference getNextValue() { 091 return this.nextValue; 092 } 093 094 public void setChange(final String change) { 095 this.change = change; 096 } 097 098 public void setPreviousValue(final com.commercetools.history.models.common.Reference previousValue) { 099 this.previousValue = previousValue; 100 } 101 102 public void setNextValue(final com.commercetools.history.models.common.Reference nextValue) { 103 this.nextValue = nextValue; 104 } 105 106 @Override 107 public boolean equals(Object o) { 108 if (this == o) 109 return true; 110 111 if (o == null || getClass() != o.getClass()) 112 return false; 113 114 TransitionStateChangeImpl that = (TransitionStateChangeImpl) o; 115 116 return new EqualsBuilder().append(type, that.type) 117 .append(change, that.change) 118 .append(previousValue, that.previousValue) 119 .append(nextValue, that.nextValue) 120 .append(type, that.type) 121 .append(change, that.change) 122 .append(previousValue, that.previousValue) 123 .append(nextValue, that.nextValue) 124 .isEquals(); 125 } 126 127 @Override 128 public int hashCode() { 129 return new HashCodeBuilder(17, 37).append(type) 130 .append(change) 131 .append(previousValue) 132 .append(nextValue) 133 .toHashCode(); 134 } 135 136}