001
002package com.commercetools.importapi.models.common;
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 * TypedMoney
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class TypedMoneyImpl implements TypedMoney, ModelBase {
022
023    private com.commercetools.importapi.models.common.MoneyType type;
024
025    private Integer fractionDigits;
026
027    private Long centAmount;
028
029    private String currencyCode;
030
031    /**
032     * create instance with all properties
033     */
034    @JsonCreator
035    TypedMoneyImpl(@JsonProperty("type") final com.commercetools.importapi.models.common.MoneyType type,
036            @JsonProperty("fractionDigits") final Integer fractionDigits,
037            @JsonProperty("centAmount") final Long centAmount,
038            @JsonProperty("currencyCode") final String currencyCode) {
039        this.type = type;
040        this.fractionDigits = fractionDigits;
041        this.centAmount = centAmount;
042        this.currencyCode = currencyCode;
043    }
044
045    /**
046     * create empty instance
047     */
048    public TypedMoneyImpl() {
049    }
050
051    /**
052     *
053     */
054
055    public com.commercetools.importapi.models.common.MoneyType getType() {
056        return this.type;
057    }
058
059    /**
060     *
061     */
062
063    public Integer getFractionDigits() {
064        return this.fractionDigits;
065    }
066
067    /**
068     *
069     */
070
071    public Long getCentAmount() {
072        return this.centAmount;
073    }
074
075    /**
076     *  <p>The currency code compliant to ISO 4217.</p>
077     */
078
079    public String getCurrencyCode() {
080        return this.currencyCode;
081    }
082
083    public void setFractionDigits(final Integer fractionDigits) {
084        this.fractionDigits = fractionDigits;
085    }
086
087    public void setCentAmount(final Long centAmount) {
088        this.centAmount = centAmount;
089    }
090
091    public void setCurrencyCode(final String currencyCode) {
092        this.currencyCode = currencyCode;
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        TypedMoneyImpl that = (TypedMoneyImpl) o;
104
105        return new EqualsBuilder().append(type, that.type)
106                .append(fractionDigits, that.fractionDigits)
107                .append(centAmount, that.centAmount)
108                .append(currencyCode, that.currencyCode)
109                .isEquals();
110    }
111
112    @Override
113    public int hashCode() {
114        return new HashCodeBuilder(17, 37).append(type)
115                .append(fractionDigits)
116                .append(centAmount)
117                .append(currencyCode)
118                .toHashCode();
119    }
120
121}