001
002package com.commercetools.api.models.product;
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 * ProductChangePriceAction
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ProductChangePriceActionImpl implements ProductChangePriceAction, ModelBase {
022
023    private String action;
024
025    private String priceId;
026
027    private com.commercetools.api.models.common.PriceDraft price;
028
029    private Boolean staged;
030
031    /**
032     * create instance with all properties
033     */
034    @JsonCreator
035    ProductChangePriceActionImpl(@JsonProperty("priceId") final String priceId,
036            @JsonProperty("price") final com.commercetools.api.models.common.PriceDraft price,
037            @JsonProperty("staged") final Boolean staged) {
038        this.priceId = priceId;
039        this.price = price;
040        this.staged = staged;
041        this.action = CHANGE_PRICE;
042    }
043
044    /**
045     * create empty instance
046     */
047    public ProductChangePriceActionImpl() {
048        this.action = CHANGE_PRICE;
049    }
050
051    /**
052     *
053     */
054
055    public String getAction() {
056        return this.action;
057    }
058
059    /**
060     *  <p>The <code>id</code> of the Embedded Price to update.</p>
061     */
062
063    public String getPriceId() {
064        return this.priceId;
065    }
066
067    /**
068     *  <p>Value to set.</p>
069     */
070
071    public com.commercetools.api.models.common.PriceDraft getPrice() {
072        return this.price;
073    }
074
075    /**
076     *  <p>If <code>true</code>, only the staged Embedded Price is updated. If <code>false</code>, both the current and staged Embedded Price are updated.</p>
077     */
078
079    public Boolean getStaged() {
080        return this.staged;
081    }
082
083    public void setPriceId(final String priceId) {
084        this.priceId = priceId;
085    }
086
087    public void setPrice(final com.commercetools.api.models.common.PriceDraft price) {
088        this.price = price;
089    }
090
091    public void setStaged(final Boolean staged) {
092        this.staged = staged;
093    }
094
095    @Override
096    public boolean equals(Object o) {
097        if (this == o)
098            return true;
099
100        if (o == null || getClass() != o.getClass())
101            return false;
102
103        ProductChangePriceActionImpl that = (ProductChangePriceActionImpl) o;
104
105        return new EqualsBuilder().append(action, that.action)
106                .append(priceId, that.priceId)
107                .append(price, that.price)
108                .append(staged, that.staged)
109                .isEquals();
110    }
111
112    @Override
113    public int hashCode() {
114        return new HashCodeBuilder(17, 37).append(action).append(priceId).append(price).append(staged).toHashCode();
115    }
116
117}