001 002package com.commercetools.history.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 * DiscountedLineItemPortion 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class DiscountedLineItemPortionImpl implements DiscountedLineItemPortion, ModelBase { 022 023 private com.commercetools.history.models.common.Reference discount; 024 025 private com.commercetools.history.models.common.Money discountedAmount; 026 027 /** 028 * create instance with all properties 029 */ 030 @JsonCreator 031 DiscountedLineItemPortionImpl( 032 @JsonProperty("discount") final com.commercetools.history.models.common.Reference discount, 033 @JsonProperty("discountedAmount") final com.commercetools.history.models.common.Money discountedAmount) { 034 this.discount = discount; 035 this.discountedAmount = discountedAmount; 036 } 037 038 /** 039 * create empty instance 040 */ 041 public DiscountedLineItemPortionImpl() { 042 } 043 044 /** 045 * 046 */ 047 048 public com.commercetools.history.models.common.Reference getDiscount() { 049 return this.discount; 050 } 051 052 /** 053 * 054 */ 055 056 public com.commercetools.history.models.common.Money getDiscountedAmount() { 057 return this.discountedAmount; 058 } 059 060 public void setDiscount(final com.commercetools.history.models.common.Reference discount) { 061 this.discount = discount; 062 } 063 064 public void setDiscountedAmount(final com.commercetools.history.models.common.Money discountedAmount) { 065 this.discountedAmount = discountedAmount; 066 } 067 068 @Override 069 public boolean equals(Object o) { 070 if (this == o) 071 return true; 072 073 if (o == null || getClass() != o.getClass()) 074 return false; 075 076 DiscountedLineItemPortionImpl that = (DiscountedLineItemPortionImpl) o; 077 078 return new EqualsBuilder().append(discount, that.discount) 079 .append(discountedAmount, that.discountedAmount) 080 .append(discount, that.discount) 081 .append(discountedAmount, that.discountedAmount) 082 .isEquals(); 083 } 084 085 @Override 086 public int hashCode() { 087 return new HashCodeBuilder(17, 37).append(discount).append(discountedAmount).toHashCode(); 088 } 089 090}