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