001 002package com.commercetools.api.models.store; 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.store_country.StoreCountry; 013import com.fasterxml.jackson.annotation.*; 014import com.fasterxml.jackson.databind.annotation.*; 015 016import io.vrap.rmf.base.client.utils.Generated; 017 018/** 019 * <p>This update action produces the StoreCountriesChanged Message. It has no effect if the given country is already present in a Store.</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 * StoreAddCountryAction storeAddCountryAction = StoreAddCountryAction.builder() 026 * .country(countryBuilder -> countryBuilder) 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 = StoreAddCountryActionImpl.class) 033public interface StoreAddCountryAction extends StoreUpdateAction { 034 035 /** 036 * discriminator value for StoreAddCountryAction 037 */ 038 String ADD_COUNTRY = "addCountry"; 039 040 /** 041 * <p>Value to append to <code>countries</code>.</p> 042 * @return country 043 */ 044 @NotNull 045 @Valid 046 @JsonProperty("country") 047 public StoreCountry getCountry(); 048 049 /** 050 * <p>Value to append to <code>countries</code>.</p> 051 * @param country value to be set 052 */ 053 054 public void setCountry(final StoreCountry country); 055 056 /** 057 * factory method 058 * @return instance of StoreAddCountryAction 059 */ 060 public static StoreAddCountryAction of() { 061 return new StoreAddCountryActionImpl(); 062 } 063 064 /** 065 * factory method to create a shallow copy StoreAddCountryAction 066 * @param template instance to be copied 067 * @return copy instance 068 */ 069 public static StoreAddCountryAction of(final StoreAddCountryAction template) { 070 StoreAddCountryActionImpl instance = new StoreAddCountryActionImpl(); 071 instance.setCountry(template.getCountry()); 072 return instance; 073 } 074 075 /** 076 * factory method to create a deep copy of StoreAddCountryAction 077 * @param template instance to be copied 078 * @return copy instance 079 */ 080 @Nullable 081 public static StoreAddCountryAction deepCopy(@Nullable final StoreAddCountryAction template) { 082 if (template == null) { 083 return null; 084 } 085 StoreAddCountryActionImpl instance = new StoreAddCountryActionImpl(); 086 instance.setCountry(com.commercetools.api.models.store_country.StoreCountry.deepCopy(template.getCountry())); 087 return instance; 088 } 089 090 /** 091 * builder factory method for StoreAddCountryAction 092 * @return builder 093 */ 094 public static StoreAddCountryActionBuilder builder() { 095 return StoreAddCountryActionBuilder.of(); 096 } 097 098 /** 099 * create builder for StoreAddCountryAction instance 100 * @param template instance with prefilled values for the builder 101 * @return builder 102 */ 103 public static StoreAddCountryActionBuilder builder(final StoreAddCountryAction template) { 104 return StoreAddCountryActionBuilder.of(template); 105 } 106 107 /** 108 * accessor map function 109 * @param <T> mapped type 110 * @param helper function to map the object 111 * @return mapped value 112 */ 113 default <T> T withStoreAddCountryAction(Function<StoreAddCountryAction, T> helper) { 114 return helper.apply(this); 115 } 116 117 /** 118 * gives a TypeReference for usage with Jackson DataBind 119 * @return TypeReference 120 */ 121 public static com.fasterxml.jackson.core.type.TypeReference<StoreAddCountryAction> typeReference() { 122 return new com.fasterxml.jackson.core.type.TypeReference<StoreAddCountryAction>() { 123 @Override 124 public String toString() { 125 return "TypeReference<StoreAddCountryAction>"; 126 } 127 }; 128 } 129}