001 002package com.commercetools.api.models.standalone_price; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.Valid; 010import javax.validation.constraints.NotNull; 011 012import com.commercetools.api.models.common.Money; 013import com.fasterxml.jackson.annotation.*; 014import com.fasterxml.jackson.databind.annotation.*; 015 016import io.vrap.rmf.base.client.utils.Generated; 017 018/** 019 * <p>Updating the value of a StandalonePrice produces the StandalonePriceValueChangedMessage.</p> 020 * 021 * <hr> 022 * Example to create an instance using the builder pattern 023 * <div class=code-example> 024 * <pre><code class='java'> 025 * StandalonePriceChangeValueAction standalonePriceChangeValueAction = StandalonePriceChangeValueAction.builder() 026 * .value(valueBuilder -> valueBuilder) 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 = StandalonePriceChangeValueActionImpl.class) 033public interface StandalonePriceChangeValueAction extends StandalonePriceUpdateAction { 034 035 /** 036 * discriminator value for StandalonePriceChangeValueAction 037 */ 038 String CHANGE_VALUE = "changeValue"; 039 040 /** 041 * <p>New value to set. Must not be empty.</p> 042 * @return value 043 */ 044 @NotNull 045 @Valid 046 @JsonProperty("value") 047 public Money getValue(); 048 049 /** 050 * <p>If set to <code>true</code> the update action applies to the StagedStandalonePrice. If set to <code>false</code>, the update action applies to the current StandalonePrice.</p> 051 * @return staged 052 */ 053 054 @JsonProperty("staged") 055 public Boolean getStaged(); 056 057 /** 058 * <p>New value to set. Must not be empty.</p> 059 * @param value value to be set 060 */ 061 062 public void setValue(final Money value); 063 064 /** 065 * <p>If set to <code>true</code> the update action applies to the StagedStandalonePrice. If set to <code>false</code>, the update action applies to the current StandalonePrice.</p> 066 * @param staged value to be set 067 */ 068 069 public void setStaged(final Boolean staged); 070 071 /** 072 * factory method 073 * @return instance of StandalonePriceChangeValueAction 074 */ 075 public static StandalonePriceChangeValueAction of() { 076 return new StandalonePriceChangeValueActionImpl(); 077 } 078 079 /** 080 * factory method to create a shallow copy StandalonePriceChangeValueAction 081 * @param template instance to be copied 082 * @return copy instance 083 */ 084 public static StandalonePriceChangeValueAction of(final StandalonePriceChangeValueAction template) { 085 StandalonePriceChangeValueActionImpl instance = new StandalonePriceChangeValueActionImpl(); 086 instance.setValue(template.getValue()); 087 instance.setStaged(template.getStaged()); 088 return instance; 089 } 090 091 /** 092 * factory method to create a deep copy of StandalonePriceChangeValueAction 093 * @param template instance to be copied 094 * @return copy instance 095 */ 096 @Nullable 097 public static StandalonePriceChangeValueAction deepCopy(@Nullable final StandalonePriceChangeValueAction template) { 098 if (template == null) { 099 return null; 100 } 101 StandalonePriceChangeValueActionImpl instance = new StandalonePriceChangeValueActionImpl(); 102 instance.setValue(com.commercetools.api.models.common.Money.deepCopy(template.getValue())); 103 instance.setStaged(template.getStaged()); 104 return instance; 105 } 106 107 /** 108 * builder factory method for StandalonePriceChangeValueAction 109 * @return builder 110 */ 111 public static StandalonePriceChangeValueActionBuilder builder() { 112 return StandalonePriceChangeValueActionBuilder.of(); 113 } 114 115 /** 116 * create builder for StandalonePriceChangeValueAction instance 117 * @param template instance with prefilled values for the builder 118 * @return builder 119 */ 120 public static StandalonePriceChangeValueActionBuilder builder(final StandalonePriceChangeValueAction template) { 121 return StandalonePriceChangeValueActionBuilder.of(template); 122 } 123 124 /** 125 * accessor map function 126 * @param <T> mapped type 127 * @param helper function to map the object 128 * @return mapped value 129 */ 130 default <T> T withStandalonePriceChangeValueAction(Function<StandalonePriceChangeValueAction, T> helper) { 131 return helper.apply(this); 132 } 133 134 /** 135 * gives a TypeReference for usage with Jackson DataBind 136 * @return TypeReference 137 */ 138 public static com.fasterxml.jackson.core.type.TypeReference<StandalonePriceChangeValueAction> typeReference() { 139 return new com.fasterxml.jackson.core.type.TypeReference<StandalonePriceChangeValueAction>() { 140 @Override 141 public String toString() { 142 return "TypeReference<StandalonePriceChangeValueAction>"; 143 } 144 }; 145 } 146}