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 * Delivery 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class DeliveryImpl implements Delivery, ModelBase { 022 023 private String id; 024 025 private String createdAt; 026 027 private java.util.List<com.commercetools.history.models.common.DeliveryItem> items; 028 029 private java.util.List<com.commercetools.history.models.common.Parcel> parcels; 030 031 private com.commercetools.history.models.common.Address address; 032 033 private com.commercetools.history.models.common.CustomFields custom; 034 035 /** 036 * create instance with all properties 037 */ 038 @JsonCreator 039 DeliveryImpl(@JsonProperty("id") final String id, @JsonProperty("createdAt") final String createdAt, 040 @JsonProperty("items") final java.util.List<com.commercetools.history.models.common.DeliveryItem> items, 041 @JsonProperty("parcels") final java.util.List<com.commercetools.history.models.common.Parcel> parcels, 042 @JsonProperty("address") final com.commercetools.history.models.common.Address address, 043 @JsonProperty("custom") final com.commercetools.history.models.common.CustomFields custom) { 044 this.id = id; 045 this.createdAt = createdAt; 046 this.items = items; 047 this.parcels = parcels; 048 this.address = address; 049 this.custom = custom; 050 } 051 052 /** 053 * create empty instance 054 */ 055 public DeliveryImpl() { 056 } 057 058 /** 059 * 060 */ 061 062 public String getId() { 063 return this.id; 064 } 065 066 /** 067 * 068 */ 069 070 public String getCreatedAt() { 071 return this.createdAt; 072 } 073 074 /** 075 * 076 */ 077 078 public java.util.List<com.commercetools.history.models.common.DeliveryItem> getItems() { 079 return this.items; 080 } 081 082 /** 083 * 084 */ 085 086 public java.util.List<com.commercetools.history.models.common.Parcel> getParcels() { 087 return this.parcels; 088 } 089 090 /** 091 * 092 */ 093 094 public com.commercetools.history.models.common.Address getAddress() { 095 return this.address; 096 } 097 098 /** 099 * <p>Custom Fields for the Transaction.</p> 100 */ 101 102 public com.commercetools.history.models.common.CustomFields getCustom() { 103 return this.custom; 104 } 105 106 public void setId(final String id) { 107 this.id = id; 108 } 109 110 public void setCreatedAt(final String createdAt) { 111 this.createdAt = createdAt; 112 } 113 114 public void setItems(final com.commercetools.history.models.common.DeliveryItem... items) { 115 this.items = new ArrayList<>(Arrays.asList(items)); 116 } 117 118 public void setItems(final java.util.List<com.commercetools.history.models.common.DeliveryItem> items) { 119 this.items = items; 120 } 121 122 public void setParcels(final com.commercetools.history.models.common.Parcel... parcels) { 123 this.parcels = new ArrayList<>(Arrays.asList(parcels)); 124 } 125 126 public void setParcels(final java.util.List<com.commercetools.history.models.common.Parcel> parcels) { 127 this.parcels = parcels; 128 } 129 130 public void setAddress(final com.commercetools.history.models.common.Address address) { 131 this.address = address; 132 } 133 134 public void setCustom(final com.commercetools.history.models.common.CustomFields custom) { 135 this.custom = custom; 136 } 137 138 @Override 139 public boolean equals(Object o) { 140 if (this == o) 141 return true; 142 143 if (o == null || getClass() != o.getClass()) 144 return false; 145 146 DeliveryImpl that = (DeliveryImpl) o; 147 148 return new EqualsBuilder().append(id, that.id) 149 .append(createdAt, that.createdAt) 150 .append(items, that.items) 151 .append(parcels, that.parcels) 152 .append(address, that.address) 153 .append(custom, that.custom) 154 .append(id, that.id) 155 .append(createdAt, that.createdAt) 156 .append(items, that.items) 157 .append(parcels, that.parcels) 158 .append(address, that.address) 159 .append(custom, that.custom) 160 .isEquals(); 161 } 162 163 @Override 164 public int hashCode() { 165 return new HashCodeBuilder(17, 37).append(id) 166 .append(createdAt) 167 .append(items) 168 .append(parcels) 169 .append(address) 170 .append(custom) 171 .toHashCode(); 172 } 173 174}