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