001
002package com.commercetools.ml.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 * Money
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class MoneyImpl implements Money, ModelBase {
022
023    private Long centAmount;
024
025    private String currencyCode;
026
027    @JsonCreator
028    MoneyImpl(@JsonProperty("centAmount") final Long centAmount,
029            @JsonProperty("currencyCode") final String currencyCode) {
030        this.centAmount = centAmount;
031        this.currencyCode = currencyCode;
032    }
033
034    public MoneyImpl() {
035    }
036
037    /**
038     *
039     */
040
041    public Long getCentAmount() {
042        return this.centAmount;
043    }
044
045    /**
046     *  <p>The currency code compliant to ISO 4217.</p>
047     */
048
049    public String getCurrencyCode() {
050        return this.currencyCode;
051    }
052
053    public void setCentAmount(final Long centAmount) {
054        this.centAmount = centAmount;
055    }
056
057    public void setCurrencyCode(final String currencyCode) {
058        this.currencyCode = currencyCode;
059    }
060
061    @Override
062    public boolean equals(Object o) {
063        if (this == o)
064            return true;
065
066        if (o == null || getClass() != o.getClass())
067            return false;
068
069        MoneyImpl that = (MoneyImpl) o;
070
071        return new EqualsBuilder().append(centAmount, that.centAmount)
072                .append(currencyCode, that.currencyCode)
073                .isEquals();
074    }
075
076    @Override
077    public int hashCode() {
078        return new HashCodeBuilder(17, 37).append(centAmount).append(currencyCode).toHashCode();
079    }
080
081}