001 002package com.commercetools.importapi.models.orders; 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 * DiscountCodeInfo 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class DiscountCodeInfoImpl implements DiscountCodeInfo, ModelBase { 022 023 private com.commercetools.importapi.models.common.DiscountCodeKeyReference discountCode; 024 025 private com.commercetools.importapi.models.orders.DiscountCodeState state; 026 027 /** 028 * create instance with all properties 029 */ 030 @JsonCreator 031 DiscountCodeInfoImpl( 032 @JsonProperty("discountCode") final com.commercetools.importapi.models.common.DiscountCodeKeyReference discountCode, 033 @JsonProperty("state") final com.commercetools.importapi.models.orders.DiscountCodeState state) { 034 this.discountCode = discountCode; 035 this.state = state; 036 } 037 038 /** 039 * create empty instance 040 */ 041 public DiscountCodeInfoImpl() { 042 } 043 044 /** 045 * <p>References a discount code by key.</p> 046 */ 047 048 public com.commercetools.importapi.models.common.DiscountCodeKeyReference getDiscountCode() { 049 return this.discountCode; 050 } 051 052 /** 053 * <p>Maps to <code>DiscountCodeInfo.state</code></p> 054 */ 055 056 public com.commercetools.importapi.models.orders.DiscountCodeState getState() { 057 return this.state; 058 } 059 060 public void setDiscountCode(final com.commercetools.importapi.models.common.DiscountCodeKeyReference discountCode) { 061 this.discountCode = discountCode; 062 } 063 064 public void setState(final com.commercetools.importapi.models.orders.DiscountCodeState state) { 065 this.state = state; 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 DiscountCodeInfoImpl that = (DiscountCodeInfoImpl) o; 077 078 return new EqualsBuilder().append(discountCode, that.discountCode) 079 .append(state, that.state) 080 .append(discountCode, that.discountCode) 081 .append(state, that.state) 082 .isEquals(); 083 } 084 085 @Override 086 public int hashCode() { 087 return new HashCodeBuilder(17, 37).append(discountCode).append(state).toHashCode(); 088 } 089 090}