001 002package com.commercetools.api.models.message; 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 * <p>Generated after a successful Add Delivery update action.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class DeliveryAddedMessagePayloadImpl implements DeliveryAddedMessagePayload, ModelBase { 022 023 private String type; 024 025 private com.commercetools.api.models.order.Delivery delivery; 026 027 private String shippingKey; 028 029 /** 030 * create instance with all properties 031 */ 032 @JsonCreator 033 DeliveryAddedMessagePayloadImpl( 034 @JsonProperty("delivery") final com.commercetools.api.models.order.Delivery delivery, 035 @JsonProperty("shippingKey") final String shippingKey) { 036 this.delivery = delivery; 037 this.shippingKey = shippingKey; 038 this.type = DELIVERY_ADDED; 039 } 040 041 /** 042 * create empty instance 043 */ 044 public DeliveryAddedMessagePayloadImpl() { 045 this.type = DELIVERY_ADDED; 046 } 047 048 /** 049 * 050 */ 051 052 public String getType() { 053 return this.type; 054 } 055 056 /** 057 * <p>Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional Parcel Added To Delivery Message containing information about the Parcels.</p> 058 */ 059 060 public com.commercetools.api.models.order.Delivery getDelivery() { 061 return this.delivery; 062 } 063 064 /** 065 * <p>User-defined unique identifier of the Shipping Method in a Cart with <code>Multiple</code> ShippingMode.</p> 066 */ 067 068 public String getShippingKey() { 069 return this.shippingKey; 070 } 071 072 public void setDelivery(final com.commercetools.api.models.order.Delivery delivery) { 073 this.delivery = delivery; 074 } 075 076 public void setShippingKey(final String shippingKey) { 077 this.shippingKey = shippingKey; 078 } 079 080 @Override 081 public boolean equals(Object o) { 082 if (this == o) 083 return true; 084 085 if (o == null || getClass() != o.getClass()) 086 return false; 087 088 DeliveryAddedMessagePayloadImpl that = (DeliveryAddedMessagePayloadImpl) o; 089 090 return new EqualsBuilder().append(type, that.type) 091 .append(delivery, that.delivery) 092 .append(shippingKey, that.shippingKey) 093 .append(type, that.type) 094 .append(delivery, that.delivery) 095 .append(shippingKey, that.shippingKey) 096 .isEquals(); 097 } 098 099 @Override 100 public int hashCode() { 101 return new HashCodeBuilder(17, 37).append(type).append(delivery).append(shippingKey).toHashCode(); 102 } 103 104}