001 002package com.commercetools.api.models.cart; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.Valid; 010 011import com.commercetools.api.models.common.BaseAddress; 012import com.fasterxml.jackson.annotation.*; 013import com.fasterxml.jackson.databind.annotation.*; 014 015import io.vrap.rmf.base.client.utils.Generated; 016 017/** 018 * CartSetBillingAddressAction 019 * 020 * <hr> 021 * Example to create an instance using the builder pattern 022 * <div class=code-example> 023 * <pre><code class='java'> 024 * CartSetBillingAddressAction cartSetBillingAddressAction = CartSetBillingAddressAction.builder() 025 * .build() 026 * </code></pre> 027 * </div> 028 */ 029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 030@JsonDeserialize(as = CartSetBillingAddressActionImpl.class) 031public interface CartSetBillingAddressAction extends CartUpdateAction { 032 033 /** 034 * discriminator value for CartSetBillingAddressAction 035 */ 036 String SET_BILLING_ADDRESS = "setBillingAddress"; 037 038 /** 039 * <p>Value to set. If empty, any existing value is removed.</p> 040 * @return address 041 */ 042 @Valid 043 @JsonProperty("address") 044 public BaseAddress getAddress(); 045 046 /** 047 * <p>Value to set. If empty, any existing value is removed.</p> 048 * @param address value to be set 049 */ 050 051 public void setAddress(final BaseAddress address); 052 053 /** 054 * factory method 055 * @return instance of CartSetBillingAddressAction 056 */ 057 public static CartSetBillingAddressAction of() { 058 return new CartSetBillingAddressActionImpl(); 059 } 060 061 /** 062 * factory method to create a shallow copy CartSetBillingAddressAction 063 * @param template instance to be copied 064 * @return copy instance 065 */ 066 public static CartSetBillingAddressAction of(final CartSetBillingAddressAction template) { 067 CartSetBillingAddressActionImpl instance = new CartSetBillingAddressActionImpl(); 068 instance.setAddress(template.getAddress()); 069 return instance; 070 } 071 072 /** 073 * factory method to create a deep copy of CartSetBillingAddressAction 074 * @param template instance to be copied 075 * @return copy instance 076 */ 077 @Nullable 078 public static CartSetBillingAddressAction deepCopy(@Nullable final CartSetBillingAddressAction template) { 079 if (template == null) { 080 return null; 081 } 082 CartSetBillingAddressActionImpl instance = new CartSetBillingAddressActionImpl(); 083 instance.setAddress(com.commercetools.api.models.common.BaseAddress.deepCopy(template.getAddress())); 084 return instance; 085 } 086 087 /** 088 * builder factory method for CartSetBillingAddressAction 089 * @return builder 090 */ 091 public static CartSetBillingAddressActionBuilder builder() { 092 return CartSetBillingAddressActionBuilder.of(); 093 } 094 095 /** 096 * create builder for CartSetBillingAddressAction instance 097 * @param template instance with prefilled values for the builder 098 * @return builder 099 */ 100 public static CartSetBillingAddressActionBuilder builder(final CartSetBillingAddressAction template) { 101 return CartSetBillingAddressActionBuilder.of(template); 102 } 103 104 /** 105 * accessor map function 106 * @param <T> mapped type 107 * @param helper function to map the object 108 * @return mapped value 109 */ 110 default <T> T withCartSetBillingAddressAction(Function<CartSetBillingAddressAction, T> helper) { 111 return helper.apply(this); 112 } 113 114 /** 115 * gives a TypeReference for usage with Jackson DataBind 116 * @return TypeReference 117 */ 118 public static com.fasterxml.jackson.core.type.TypeReference<CartSetBillingAddressAction> typeReference() { 119 return new com.fasterxml.jackson.core.type.TypeReference<CartSetBillingAddressAction>() { 120 @Override 121 public String toString() { 122 return "TypeReference<CartSetBillingAddressAction>"; 123 } 124 }; 125 } 126}