001 002package com.commercetools.api.models.inventory; 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 * InventoryEntryDraft 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class InventoryEntryDraftImpl implements InventoryEntryDraft, ModelBase { 022 023 private String sku; 024 025 private String key; 026 027 private com.commercetools.api.models.channel.ChannelResourceIdentifier supplyChannel; 028 029 private Long quantityOnStock; 030 031 private Long restockableInDays; 032 033 private java.time.ZonedDateTime expectedDelivery; 034 035 private com.commercetools.api.models.type.CustomFieldsDraft custom; 036 037 /** 038 * create instance with all properties 039 */ 040 @JsonCreator 041 InventoryEntryDraftImpl(@JsonProperty("sku") final String sku, @JsonProperty("key") final String key, 042 @JsonProperty("supplyChannel") final com.commercetools.api.models.channel.ChannelResourceIdentifier supplyChannel, 043 @JsonProperty("quantityOnStock") final Long quantityOnStock, 044 @JsonProperty("restockableInDays") final Long restockableInDays, 045 @JsonProperty("expectedDelivery") final java.time.ZonedDateTime expectedDelivery, 046 @JsonProperty("custom") final com.commercetools.api.models.type.CustomFieldsDraft custom) { 047 this.sku = sku; 048 this.key = key; 049 this.supplyChannel = supplyChannel; 050 this.quantityOnStock = quantityOnStock; 051 this.restockableInDays = restockableInDays; 052 this.expectedDelivery = expectedDelivery; 053 this.custom = custom; 054 } 055 056 /** 057 * create empty instance 058 */ 059 public InventoryEntryDraftImpl() { 060 } 061 062 /** 063 * <p>ProductVariant <code>sku</code> of the InventoryEntry.</p> 064 */ 065 066 public String getSku() { 067 return this.sku; 068 } 069 070 /** 071 * <p>User-defined unique identifier for the InventoryEntry.</p> 072 */ 073 074 public String getKey() { 075 return this.key; 076 } 077 078 /** 079 * <p>Channel that supplies this InventoryEntry.</p> 080 */ 081 082 public com.commercetools.api.models.channel.ChannelResourceIdentifier getSupplyChannel() { 083 return this.supplyChannel; 084 } 085 086 /** 087 * <p>Overall amount of stock.</p> 088 */ 089 090 public Long getQuantityOnStock() { 091 return this.quantityOnStock; 092 } 093 094 /** 095 * <p>How often the InventoryEntry is restocked (in days).</p> 096 */ 097 098 public Long getRestockableInDays() { 099 return this.restockableInDays; 100 } 101 102 /** 103 * <p>Date and time of the next restock.</p> 104 */ 105 106 public java.time.ZonedDateTime getExpectedDelivery() { 107 return this.expectedDelivery; 108 } 109 110 /** 111 * <p>Custom Fields of the InventoryEntry.</p> 112 */ 113 114 public com.commercetools.api.models.type.CustomFieldsDraft getCustom() { 115 return this.custom; 116 } 117 118 public void setSku(final String sku) { 119 this.sku = sku; 120 } 121 122 public void setKey(final String key) { 123 this.key = key; 124 } 125 126 public void setSupplyChannel(final com.commercetools.api.models.channel.ChannelResourceIdentifier supplyChannel) { 127 this.supplyChannel = supplyChannel; 128 } 129 130 public void setQuantityOnStock(final Long quantityOnStock) { 131 this.quantityOnStock = quantityOnStock; 132 } 133 134 public void setRestockableInDays(final Long restockableInDays) { 135 this.restockableInDays = restockableInDays; 136 } 137 138 public void setExpectedDelivery(final java.time.ZonedDateTime expectedDelivery) { 139 this.expectedDelivery = expectedDelivery; 140 } 141 142 public void setCustom(final com.commercetools.api.models.type.CustomFieldsDraft custom) { 143 this.custom = custom; 144 } 145 146 @Override 147 public boolean equals(Object o) { 148 if (this == o) 149 return true; 150 151 if (o == null || getClass() != o.getClass()) 152 return false; 153 154 InventoryEntryDraftImpl that = (InventoryEntryDraftImpl) o; 155 156 return new EqualsBuilder().append(sku, that.sku) 157 .append(key, that.key) 158 .append(supplyChannel, that.supplyChannel) 159 .append(quantityOnStock, that.quantityOnStock) 160 .append(restockableInDays, that.restockableInDays) 161 .append(expectedDelivery, that.expectedDelivery) 162 .append(custom, that.custom) 163 .append(sku, that.sku) 164 .append(key, that.key) 165 .append(supplyChannel, that.supplyChannel) 166 .append(quantityOnStock, that.quantityOnStock) 167 .append(restockableInDays, that.restockableInDays) 168 .append(expectedDelivery, that.expectedDelivery) 169 .append(custom, that.custom) 170 .isEquals(); 171 } 172 173 @Override 174 public int hashCode() { 175 return new HashCodeBuilder(17, 37).append(sku) 176 .append(key) 177 .append(supplyChannel) 178 .append(quantityOnStock) 179 .append(restockableInDays) 180 .append(expectedDelivery) 181 .append(custom) 182 .toHashCode(); 183 } 184 185}