001 002package com.commercetools.api.models.message; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.constraints.NotNull; 010 011import com.commercetools.api.models.order.ShipmentState; 012import com.fasterxml.jackson.annotation.*; 013import com.fasterxml.jackson.databind.annotation.*; 014 015import io.vrap.rmf.base.client.utils.Generated; 016 017/** 018 * <p>Generated after a successful Change ShipmentState update action.</p> 019 * 020 * <hr> 021 * Example to create an instance using the builder pattern 022 * <div class=code-example> 023 * <pre><code class='java'> 024 * OrderShipmentStateChangedMessagePayload orderShipmentStateChangedMessagePayload = OrderShipmentStateChangedMessagePayload.builder() 025 * .shipmentState(ShipmentState.SHIPPED) 026 * .oldShipmentState(ShipmentState.SHIPPED) 027 * .build() 028 * </code></pre> 029 * </div> 030 */ 031@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 032@JsonDeserialize(as = OrderShipmentStateChangedMessagePayloadImpl.class) 033public interface OrderShipmentStateChangedMessagePayload extends OrderMessagePayload { 034 035 /** 036 * discriminator value for OrderShipmentStateChangedMessagePayload 037 */ 038 String ORDER_SHIPMENT_STATE_CHANGED = "OrderShipmentStateChanged"; 039 040 /** 041 * <p>ShipmentState after the Change Shipment State update action.</p> 042 * @return shipmentState 043 */ 044 @NotNull 045 @JsonProperty("shipmentState") 046 public ShipmentState getShipmentState(); 047 048 /** 049 * <p>ShipmentState before the Change Shipment State update action.</p> 050 * @return oldShipmentState 051 */ 052 @NotNull 053 @JsonProperty("oldShipmentState") 054 public ShipmentState getOldShipmentState(); 055 056 /** 057 * <p>ShipmentState after the Change Shipment State update action.</p> 058 * @param shipmentState value to be set 059 */ 060 061 public void setShipmentState(final ShipmentState shipmentState); 062 063 /** 064 * <p>ShipmentState before the Change Shipment State update action.</p> 065 * @param oldShipmentState value to be set 066 */ 067 068 public void setOldShipmentState(final ShipmentState oldShipmentState); 069 070 /** 071 * factory method 072 * @return instance of OrderShipmentStateChangedMessagePayload 073 */ 074 public static OrderShipmentStateChangedMessagePayload of() { 075 return new OrderShipmentStateChangedMessagePayloadImpl(); 076 } 077 078 /** 079 * factory method to create a shallow copy OrderShipmentStateChangedMessagePayload 080 * @param template instance to be copied 081 * @return copy instance 082 */ 083 public static OrderShipmentStateChangedMessagePayload of(final OrderShipmentStateChangedMessagePayload template) { 084 OrderShipmentStateChangedMessagePayloadImpl instance = new OrderShipmentStateChangedMessagePayloadImpl(); 085 instance.setShipmentState(template.getShipmentState()); 086 instance.setOldShipmentState(template.getOldShipmentState()); 087 return instance; 088 } 089 090 /** 091 * factory method to create a deep copy of OrderShipmentStateChangedMessagePayload 092 * @param template instance to be copied 093 * @return copy instance 094 */ 095 @Nullable 096 public static OrderShipmentStateChangedMessagePayload deepCopy( 097 @Nullable final OrderShipmentStateChangedMessagePayload template) { 098 if (template == null) { 099 return null; 100 } 101 OrderShipmentStateChangedMessagePayloadImpl instance = new OrderShipmentStateChangedMessagePayloadImpl(); 102 instance.setShipmentState(template.getShipmentState()); 103 instance.setOldShipmentState(template.getOldShipmentState()); 104 return instance; 105 } 106 107 /** 108 * builder factory method for OrderShipmentStateChangedMessagePayload 109 * @return builder 110 */ 111 public static OrderShipmentStateChangedMessagePayloadBuilder builder() { 112 return OrderShipmentStateChangedMessagePayloadBuilder.of(); 113 } 114 115 /** 116 * create builder for OrderShipmentStateChangedMessagePayload instance 117 * @param template instance with prefilled values for the builder 118 * @return builder 119 */ 120 public static OrderShipmentStateChangedMessagePayloadBuilder builder( 121 final OrderShipmentStateChangedMessagePayload template) { 122 return OrderShipmentStateChangedMessagePayloadBuilder.of(template); 123 } 124 125 /** 126 * accessor map function 127 * @param <T> mapped type 128 * @param helper function to map the object 129 * @return mapped value 130 */ 131 default <T> T withOrderShipmentStateChangedMessagePayload( 132 Function<OrderShipmentStateChangedMessagePayload, T> helper) { 133 return helper.apply(this); 134 } 135 136 /** 137 * gives a TypeReference for usage with Jackson DataBind 138 * @return TypeReference 139 */ 140 public static com.fasterxml.jackson.core.type.TypeReference<OrderShipmentStateChangedMessagePayload> typeReference() { 141 return new com.fasterxml.jackson.core.type.TypeReference<OrderShipmentStateChangedMessagePayload>() { 142 @Override 143 public String toString() { 144 return "TypeReference<OrderShipmentStateChangedMessagePayload>"; 145 } 146 }; 147 } 148}