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 Change Custom Line Item Quantity update action.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class OrderCustomLineItemQuantityChangedMessagePayloadImpl 022 implements OrderCustomLineItemQuantityChangedMessagePayload, ModelBase { 023 024 private String type; 025 026 private String customLineItemId; 027 028 private Long quantity; 029 030 private Long oldQuantity; 031 032 /** 033 * create instance with all properties 034 */ 035 @JsonCreator 036 OrderCustomLineItemQuantityChangedMessagePayloadImpl( 037 @JsonProperty("customLineItemId") final String customLineItemId, 038 @JsonProperty("quantity") final Long quantity, @JsonProperty("oldQuantity") final Long oldQuantity) { 039 this.customLineItemId = customLineItemId; 040 this.quantity = quantity; 041 this.oldQuantity = oldQuantity; 042 this.type = ORDER_CUSTOM_LINE_ITEM_QUANTITY_CHANGED; 043 } 044 045 /** 046 * create empty instance 047 */ 048 public OrderCustomLineItemQuantityChangedMessagePayloadImpl() { 049 this.type = ORDER_CUSTOM_LINE_ITEM_QUANTITY_CHANGED; 050 } 051 052 /** 053 * 054 */ 055 056 public String getType() { 057 return this.type; 058 } 059 060 /** 061 * <p>Unique identifier of the Custom Line Item.</p> 062 */ 063 064 public String getCustomLineItemId() { 065 return this.customLineItemId; 066 } 067 068 /** 069 * <p>Custom Line Item quantity after the Change Custom Line Item Quantity update action.</p> 070 */ 071 072 public Long getQuantity() { 073 return this.quantity; 074 } 075 076 /** 077 * <p>Custom Line Item quantity before the Change Custom Line Item Quantity update action.</p> 078 */ 079 080 public Long getOldQuantity() { 081 return this.oldQuantity; 082 } 083 084 public void setCustomLineItemId(final String customLineItemId) { 085 this.customLineItemId = customLineItemId; 086 } 087 088 public void setQuantity(final Long quantity) { 089 this.quantity = quantity; 090 } 091 092 public void setOldQuantity(final Long oldQuantity) { 093 this.oldQuantity = oldQuantity; 094 } 095 096 @Override 097 public boolean equals(Object o) { 098 if (this == o) 099 return true; 100 101 if (o == null || getClass() != o.getClass()) 102 return false; 103 104 OrderCustomLineItemQuantityChangedMessagePayloadImpl that = (OrderCustomLineItemQuantityChangedMessagePayloadImpl) o; 105 106 return new EqualsBuilder().append(type, that.type) 107 .append(customLineItemId, that.customLineItemId) 108 .append(quantity, that.quantity) 109 .append(oldQuantity, that.oldQuantity) 110 .isEquals(); 111 } 112 113 @Override 114 public int hashCode() { 115 return new HashCodeBuilder(17, 37).append(type) 116 .append(customLineItemId) 117 .append(quantity) 118 .append(oldQuantity) 119 .toHashCode(); 120 } 121 122}