001 002package com.commercetools.api.models.message; 003 004import java.time.*; 005import java.time.ZonedDateTime; 006import java.util.*; 007import java.util.function.Function; 008 009import javax.annotation.Nullable; 010 011import com.fasterxml.jackson.annotation.*; 012import com.fasterxml.jackson.databind.annotation.*; 013 014import io.vrap.rmf.base.client.utils.Generated; 015 016/** 017 * <p>Generated after a successful Set Valid From update action.</p> 018 * 019 * <hr> 020 * Example to create an instance using the builder pattern 021 * <div class=code-example> 022 * <pre><code class='java'> 023 * StandalonePriceValidFromSetMessage standalonePriceValidFromSetMessage = StandalonePriceValidFromSetMessage.builder() 024 * .id("{id}") 025 * .version(0.3) 026 * .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z")) 027 * .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z")) 028 * .sequenceNumber(0.3) 029 * .resource(resourceBuilder -> resourceBuilder) 030 * .resourceVersion(0.3) 031 * .build() 032 * </code></pre> 033 * </div> 034 */ 035@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 036@JsonDeserialize(as = StandalonePriceValidFromSetMessageImpl.class) 037public interface StandalonePriceValidFromSetMessage extends Message { 038 039 /** 040 * discriminator value for StandalonePriceValidFromSetMessage 041 */ 042 String STANDALONE_PRICE_VALID_FROM_SET = "StandalonePriceValidFromSet"; 043 044 /** 045 * <p>Value of StandalonePrice <code>validFrom</code> after the Set Valid From update action.</p> 046 * @return validFrom 047 */ 048 049 @JsonProperty("validFrom") 050 public ZonedDateTime getValidFrom(); 051 052 /** 053 * <p>Value of StandalonePrice <code>validFrom</code> before the Set Valid From update action.</p> 054 * @return previousValidFrom 055 */ 056 057 @JsonProperty("previousValidFrom") 058 public ZonedDateTime getPreviousValidFrom(); 059 060 /** 061 * <p>Value of StandalonePrice <code>validFrom</code> after the Set Valid From update action.</p> 062 * @param validFrom value to be set 063 */ 064 065 public void setValidFrom(final ZonedDateTime validFrom); 066 067 /** 068 * <p>Value of StandalonePrice <code>validFrom</code> before the Set Valid From update action.</p> 069 * @param previousValidFrom value to be set 070 */ 071 072 public void setPreviousValidFrom(final ZonedDateTime previousValidFrom); 073 074 /** 075 * factory method 076 * @return instance of StandalonePriceValidFromSetMessage 077 */ 078 public static StandalonePriceValidFromSetMessage of() { 079 return new StandalonePriceValidFromSetMessageImpl(); 080 } 081 082 /** 083 * factory method to create a shallow copy StandalonePriceValidFromSetMessage 084 * @param template instance to be copied 085 * @return copy instance 086 */ 087 public static StandalonePriceValidFromSetMessage of(final StandalonePriceValidFromSetMessage template) { 088 StandalonePriceValidFromSetMessageImpl instance = new StandalonePriceValidFromSetMessageImpl(); 089 instance.setId(template.getId()); 090 instance.setVersion(template.getVersion()); 091 instance.setCreatedAt(template.getCreatedAt()); 092 instance.setLastModifiedAt(template.getLastModifiedAt()); 093 instance.setLastModifiedBy(template.getLastModifiedBy()); 094 instance.setCreatedBy(template.getCreatedBy()); 095 instance.setSequenceNumber(template.getSequenceNumber()); 096 instance.setResource(template.getResource()); 097 instance.setResourceVersion(template.getResourceVersion()); 098 instance.setResourceUserProvidedIdentifiers(template.getResourceUserProvidedIdentifiers()); 099 instance.setValidFrom(template.getValidFrom()); 100 instance.setPreviousValidFrom(template.getPreviousValidFrom()); 101 return instance; 102 } 103 104 /** 105 * factory method to create a deep copy of StandalonePriceValidFromSetMessage 106 * @param template instance to be copied 107 * @return copy instance 108 */ 109 @Nullable 110 public static StandalonePriceValidFromSetMessage deepCopy( 111 @Nullable final StandalonePriceValidFromSetMessage template) { 112 if (template == null) { 113 return null; 114 } 115 StandalonePriceValidFromSetMessageImpl instance = new StandalonePriceValidFromSetMessageImpl(); 116 instance.setId(template.getId()); 117 instance.setVersion(template.getVersion()); 118 instance.setCreatedAt(template.getCreatedAt()); 119 instance.setLastModifiedAt(template.getLastModifiedAt()); 120 instance.setLastModifiedBy( 121 com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy())); 122 instance.setCreatedBy(com.commercetools.api.models.common.CreatedBy.deepCopy(template.getCreatedBy())); 123 instance.setSequenceNumber(template.getSequenceNumber()); 124 instance.setResource(com.commercetools.api.models.common.Reference.deepCopy(template.getResource())); 125 instance.setResourceVersion(template.getResourceVersion()); 126 instance.setResourceUserProvidedIdentifiers(com.commercetools.api.models.message.UserProvidedIdentifiers 127 .deepCopy(template.getResourceUserProvidedIdentifiers())); 128 instance.setValidFrom(template.getValidFrom()); 129 instance.setPreviousValidFrom(template.getPreviousValidFrom()); 130 return instance; 131 } 132 133 /** 134 * builder factory method for StandalonePriceValidFromSetMessage 135 * @return builder 136 */ 137 public static StandalonePriceValidFromSetMessageBuilder builder() { 138 return StandalonePriceValidFromSetMessageBuilder.of(); 139 } 140 141 /** 142 * create builder for StandalonePriceValidFromSetMessage instance 143 * @param template instance with prefilled values for the builder 144 * @return builder 145 */ 146 public static StandalonePriceValidFromSetMessageBuilder builder(final StandalonePriceValidFromSetMessage template) { 147 return StandalonePriceValidFromSetMessageBuilder.of(template); 148 } 149 150 /** 151 * accessor map function 152 * @param <T> mapped type 153 * @param helper function to map the object 154 * @return mapped value 155 */ 156 default <T> T withStandalonePriceValidFromSetMessage(Function<StandalonePriceValidFromSetMessage, T> helper) { 157 return helper.apply(this); 158 } 159 160 /** 161 * gives a TypeReference for usage with Jackson DataBind 162 * @return TypeReference 163 */ 164 public static com.fasterxml.jackson.core.type.TypeReference<StandalonePriceValidFromSetMessage> typeReference() { 165 return new com.fasterxml.jackson.core.type.TypeReference<StandalonePriceValidFromSetMessage>() { 166 @Override 167 public String toString() { 168 return "TypeReference<StandalonePriceValidFromSetMessage>"; 169 } 170 }; 171 } 172}