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 /** 028 * create instance with all properties 029 */ 030 @JsonCreator 031 MoneyImpl(@JsonProperty("centAmount") final Long centAmount, 032 @JsonProperty("currencyCode") final String currencyCode) { 033 this.centAmount = centAmount; 034 this.currencyCode = currencyCode; 035 } 036 037 /** 038 * create empty instance 039 */ 040 public MoneyImpl() { 041 } 042 043 /** 044 * 045 */ 046 047 public Long getCentAmount() { 048 return this.centAmount; 049 } 050 051 /** 052 * <p>The currency code compliant to ISO 4217.</p> 053 */ 054 055 public String getCurrencyCode() { 056 return this.currencyCode; 057 } 058 059 public void setCentAmount(final Long centAmount) { 060 this.centAmount = centAmount; 061 } 062 063 public void setCurrencyCode(final String currencyCode) { 064 this.currencyCode = currencyCode; 065 } 066 067 @Override 068 public boolean equals(Object o) { 069 if (this == o) 070 return true; 071 072 if (o == null || getClass() != o.getClass()) 073 return false; 074 075 MoneyImpl that = (MoneyImpl) o; 076 077 return new EqualsBuilder().append(centAmount, that.centAmount) 078 .append(currencyCode, that.currencyCode) 079 .isEquals(); 080 } 081 082 @Override 083 public int hashCode() { 084 return new HashCodeBuilder(17, 37).append(centAmount).append(currencyCode).toHashCode(); 085 } 086 087}