com.commercetools.history.models.change.ChangeImpl 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;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* Difference between the previous and next version of a resource represented by previousValue
(omitted, for example, on creations) and nextValue
of the associated change. A Change can also contain extra fields that provide further information.
* They are not identical to the actual update actions sent.
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class ChangeImpl implements Change, ModelBase {
private String type;
private String change;
/**
* create instance with all properties
*/
@JsonCreator
ChangeImpl(@JsonProperty("type") final String type, @JsonProperty("change") final String change) {
this.type = type;
this.change = change;
}
/**
* create empty instance
*/
public ChangeImpl() {
}
/**
* Unique discriminator value to reliably deserialize the data type.
*/
public String getType() {
return this.type;
}
/**
* Type of change on a resource that is similar to the update action it relates to, where possible. It is not a unique identifier for the data structure, for example, the setDescription
change can occur with a localized and non-localized representation.
* Records can be filtered by this value using the changes
query parameter.
*/
public String getChange() {
return this.change;
}
public void setChange(final String change) {
this.change = change;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ChangeImpl that = (ChangeImpl) o;
return new EqualsBuilder().append(type, that.type)
.append(change, that.change)
.append(type, that.type)
.append(change, that.change)
.isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(type).append(change).toHashCode();
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type)
.append("change", change)
.build();
}
}