com.commercetools.history.models.change.TransitionLineItemStateChangeImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commercetools-sdk-java-history Show documentation
Show all versions of commercetools-sdk-java-history Show documentation
The e-commerce SDK from commercetools Composable Commerce for Java
package com.commercetools.history.models.change;
import java.time.*;
import java.util.*;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.*;
import io.vrap.rmf.base.client.ModelBase;
import io.vrap.rmf.base.client.utils.Generated;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
/**
* Change triggered by the following update actions:
*
* - Change the state of LineItem according to allowed transitions on Orders.
* - Change the state of LineItem according to allowed transitions on Staged Orders.
*
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class TransitionLineItemStateChangeImpl implements TransitionLineItemStateChange, ModelBase {
private String type;
private String change;
private java.util.List previousValue;
private java.util.List nextValue;
private String lineItemId;
private String stateId;
/**
* create instance with all properties
*/
@JsonCreator
TransitionLineItemStateChangeImpl(@JsonProperty("change") final String change,
@JsonProperty("previousValue") final java.util.List previousValue,
@JsonProperty("nextValue") final java.util.List nextValue,
@JsonProperty("lineItemId") final String lineItemId, @JsonProperty("stateId") final String stateId) {
this.change = change;
this.previousValue = previousValue;
this.nextValue = nextValue;
this.lineItemId = lineItemId;
this.stateId = stateId;
this.type = TRANSITION_LINE_ITEM_STATE_CHANGE;
}
/**
* create empty instance
*/
public TransitionLineItemStateChangeImpl() {
this.type = TRANSITION_LINE_ITEM_STATE_CHANGE;
}
/**
*
*/
public String getType() {
return this.type;
}
/**
*
*/
public String getChange() {
return this.change;
}
/**
* Value before the change.
*/
public java.util.List getPreviousValue() {
return this.previousValue;
}
/**
* Value after the change.
*/
public java.util.List getNextValue() {
return this.nextValue;
}
/**
* id
of the updated LineItem.
*/
public String getLineItemId() {
return this.lineItemId;
}
/**
* id
of the State involved in the transition.
*/
public String getStateId() {
return this.stateId;
}
public void setChange(final String change) {
this.change = change;
}
public void setPreviousValue(final com.commercetools.history.models.common.ItemState... previousValue) {
this.previousValue = new ArrayList<>(Arrays.asList(previousValue));
}
public void setPreviousValue(
final java.util.List previousValue) {
this.previousValue = previousValue;
}
public void setNextValue(final com.commercetools.history.models.common.ItemState... nextValue) {
this.nextValue = new ArrayList<>(Arrays.asList(nextValue));
}
public void setNextValue(final java.util.List nextValue) {
this.nextValue = nextValue;
}
public void setLineItemId(final String lineItemId) {
this.lineItemId = lineItemId;
}
public void setStateId(final String stateId) {
this.stateId = stateId;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
TransitionLineItemStateChangeImpl that = (TransitionLineItemStateChangeImpl) o;
return new EqualsBuilder().append(type, that.type)
.append(change, that.change)
.append(previousValue, that.previousValue)
.append(nextValue, that.nextValue)
.append(lineItemId, that.lineItemId)
.append(stateId, that.stateId)
.append(type, that.type)
.append(change, that.change)
.append(previousValue, that.previousValue)
.append(nextValue, that.nextValue)
.append(lineItemId, that.lineItemId)
.append(stateId, that.stateId)
.isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(type)
.append(change)
.append(previousValue)
.append(nextValue)
.append(lineItemId)
.append(stateId)
.toHashCode();
}
}