001 002package com.commercetools.api.models.quote; 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.fasterxml.jackson.annotation.*; 012import com.fasterxml.jackson.databind.annotation.*; 013 014import io.vrap.rmf.base.client.utils.Generated; 015 016/** 017 * QuoteSetCustomFieldAction 018 * 019 * <hr> 020 * Example to create an instance using the builder pattern 021 * <div class=code-example> 022 * <pre><code class='java'> 023 * QuoteSetCustomFieldAction quoteSetCustomFieldAction = QuoteSetCustomFieldAction.builder() 024 * .name("{name}") 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 = QuoteSetCustomFieldActionImpl.class) 031public interface QuoteSetCustomFieldAction extends QuoteUpdateAction { 032 033 /** 034 * discriminator value for QuoteSetCustomFieldAction 035 */ 036 String SET_CUSTOM_FIELD = "setCustomField"; 037 038 /** 039 * <p>Name of the Custom Field.</p> 040 * @return name 041 */ 042 @NotNull 043 @JsonProperty("name") 044 public String getName(); 045 046 /** 047 * <p>If <code>value</code> is absent or <code>null</code>, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If <code>value</code> is provided, it is set for the field defined by <code>name</code>.</p> 048 * @return value 049 */ 050 051 @JsonProperty("value") 052 public Object getValue(); 053 054 /** 055 * <p>Name of the Custom Field.</p> 056 * @param name value to be set 057 */ 058 059 public void setName(final String name); 060 061 /** 062 * <p>If <code>value</code> is absent or <code>null</code>, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If <code>value</code> is provided, it is set for the field defined by <code>name</code>.</p> 063 * @param value value to be set 064 */ 065 066 public void setValue(final Object value); 067 068 /** 069 * factory method 070 * @return instance of QuoteSetCustomFieldAction 071 */ 072 public static QuoteSetCustomFieldAction of() { 073 return new QuoteSetCustomFieldActionImpl(); 074 } 075 076 /** 077 * factory method to create a shallow copy QuoteSetCustomFieldAction 078 * @param template instance to be copied 079 * @return copy instance 080 */ 081 public static QuoteSetCustomFieldAction of(final QuoteSetCustomFieldAction template) { 082 QuoteSetCustomFieldActionImpl instance = new QuoteSetCustomFieldActionImpl(); 083 instance.setName(template.getName()); 084 instance.setValue(template.getValue()); 085 return instance; 086 } 087 088 /** 089 * factory method to create a deep copy of QuoteSetCustomFieldAction 090 * @param template instance to be copied 091 * @return copy instance 092 */ 093 @Nullable 094 public static QuoteSetCustomFieldAction deepCopy(@Nullable final QuoteSetCustomFieldAction template) { 095 if (template == null) { 096 return null; 097 } 098 QuoteSetCustomFieldActionImpl instance = new QuoteSetCustomFieldActionImpl(); 099 instance.setName(template.getName()); 100 instance.setValue(template.getValue()); 101 return instance; 102 } 103 104 /** 105 * builder factory method for QuoteSetCustomFieldAction 106 * @return builder 107 */ 108 public static QuoteSetCustomFieldActionBuilder builder() { 109 return QuoteSetCustomFieldActionBuilder.of(); 110 } 111 112 /** 113 * create builder for QuoteSetCustomFieldAction instance 114 * @param template instance with prefilled values for the builder 115 * @return builder 116 */ 117 public static QuoteSetCustomFieldActionBuilder builder(final QuoteSetCustomFieldAction template) { 118 return QuoteSetCustomFieldActionBuilder.of(template); 119 } 120 121 /** 122 * accessor map function 123 * @param <T> mapped type 124 * @param helper function to map the object 125 * @return mapped value 126 */ 127 default <T> T withQuoteSetCustomFieldAction(Function<QuoteSetCustomFieldAction, T> helper) { 128 return helper.apply(this); 129 } 130 131 public static QuoteSetCustomFieldAction ofUnset(final String name) { 132 return QuoteSetCustomFieldActionBuilder.of().name(name).build(); 133 } 134 135 /** 136 * gives a TypeReference for usage with Jackson DataBind 137 * @return TypeReference 138 */ 139 public static com.fasterxml.jackson.core.type.TypeReference<QuoteSetCustomFieldAction> typeReference() { 140 return new com.fasterxml.jackson.core.type.TypeReference<QuoteSetCustomFieldAction>() { 141 @Override 142 public String toString() { 143 return "TypeReference<QuoteSetCustomFieldAction>"; 144 } 145 }; 146 } 147}