001 002package com.commercetools.api.models.order; 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>To set a <code>ReturnShipmentState</code>, the Order <code>returnInfo</code> must have at least one ReturnItem.</p> 019 * <p>Produces the Order Return Shipment State Changed Message.</p> 020 */ 021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 022public class OrderSetReturnShipmentStateActionImpl implements OrderSetReturnShipmentStateAction, ModelBase { 023 024 private String action; 025 026 private String returnItemId; 027 028 private String returnItemKey; 029 030 private com.commercetools.api.models.order.ReturnShipmentState shipmentState; 031 032 /** 033 * create instance with all properties 034 */ 035 @JsonCreator 036 OrderSetReturnShipmentStateActionImpl(@JsonProperty("returnItemId") final String returnItemId, 037 @JsonProperty("returnItemKey") final String returnItemKey, 038 @JsonProperty("shipmentState") final com.commercetools.api.models.order.ReturnShipmentState shipmentState) { 039 this.returnItemId = returnItemId; 040 this.returnItemKey = returnItemKey; 041 this.shipmentState = shipmentState; 042 this.action = SET_RETURN_SHIPMENT_STATE; 043 } 044 045 /** 046 * create empty instance 047 */ 048 public OrderSetReturnShipmentStateActionImpl() { 049 this.action = SET_RETURN_SHIPMENT_STATE; 050 } 051 052 /** 053 * 054 */ 055 056 public String getAction() { 057 return this.action; 058 } 059 060 /** 061 * <p><code>id</code> of the ReturnItem to update. Either <code>returnItemId</code> or <code>returnItemKey</code> is required.</p> 062 */ 063 064 public String getReturnItemId() { 065 return this.returnItemId; 066 } 067 068 /** 069 * <p><code>key</code> of the ReturnItem to update. Either <code>returnItemId</code> or <code>returnItemKey</code> is required.</p> 070 */ 071 072 public String getReturnItemKey() { 073 return this.returnItemKey; 074 } 075 076 /** 077 * <p>New shipment state of the ReturnItem.</p> 078 */ 079 080 public com.commercetools.api.models.order.ReturnShipmentState getShipmentState() { 081 return this.shipmentState; 082 } 083 084 public void setReturnItemId(final String returnItemId) { 085 this.returnItemId = returnItemId; 086 } 087 088 public void setReturnItemKey(final String returnItemKey) { 089 this.returnItemKey = returnItemKey; 090 } 091 092 public void setShipmentState(final com.commercetools.api.models.order.ReturnShipmentState shipmentState) { 093 this.shipmentState = shipmentState; 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 OrderSetReturnShipmentStateActionImpl that = (OrderSetReturnShipmentStateActionImpl) o; 105 106 return new EqualsBuilder().append(action, that.action) 107 .append(returnItemId, that.returnItemId) 108 .append(returnItemKey, that.returnItemKey) 109 .append(shipmentState, that.shipmentState) 110 .append(action, that.action) 111 .append(returnItemId, that.returnItemId) 112 .append(returnItemKey, that.returnItemKey) 113 .append(shipmentState, that.shipmentState) 114 .isEquals(); 115 } 116 117 @Override 118 public int hashCode() { 119 return new HashCodeBuilder(17, 37).append(action) 120 .append(returnItemId) 121 .append(returnItemKey) 122 .append(shipmentState) 123 .toHashCode(); 124 } 125 126}