-
Notifications
You must be signed in to change notification settings - Fork 15
/
CartSetShippingCustomTypeActionBuilder.java
122 lines (96 loc) · 4.22 KB
/
CartSetShippingCustomTypeActionBuilder.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
package com.commercetools.api.models.cart;
import java.util.*;
import java.util.function.Function;
import javax.annotation.Nullable;
import io.vrap.rmf.base.client.Builder;
import io.vrap.rmf.base.client.utils.Generated;
/**
* CartSetShippingCustomTypeActionBuilder
* <hr>
* Example to create an instance using the builder pattern
* <div class=code-example>
* <pre><code class='java'>
* CartSetShippingCustomTypeAction cartSetShippingCustomTypeAction = CartSetShippingCustomTypeAction.builder()
* .build()
* </code></pre>
* </div>
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class CartSetShippingCustomTypeActionBuilder implements Builder<CartSetShippingCustomTypeAction> {
@Nullable
private String shippingKey;
@Nullable
private com.commercetools.api.models.type.TypeResourceIdentifier type;
@Nullable
private com.commercetools.api.models.type.FieldContainer fields;
/**
* <p>User-defined unique identifier of the Shipping Method in a Cart with <code>Multiple</code> ShippingMode.</p>
*/
public CartSetShippingCustomTypeActionBuilder shippingKey(@Nullable final String shippingKey) {
this.shippingKey = shippingKey;
return this;
}
/**
* <p>Defines the Type that extends the <code>shippingAddress</code> with Custom Fields. If absent, any existing Type and Custom Fields are removed from the <code>shippingAddress</code>.</p>
*/
public CartSetShippingCustomTypeActionBuilder type(
Function<com.commercetools.api.models.type.TypeResourceIdentifierBuilder, com.commercetools.api.models.type.TypeResourceIdentifierBuilder> builder) {
this.type = builder.apply(com.commercetools.api.models.type.TypeResourceIdentifierBuilder.of()).build();
return this;
}
/**
* <p>Defines the Type that extends the <code>shippingAddress</code> with Custom Fields. If absent, any existing Type and Custom Fields are removed from the <code>shippingAddress</code>.</p>
*/
public CartSetShippingCustomTypeActionBuilder type(
@Nullable final com.commercetools.api.models.type.TypeResourceIdentifier type) {
this.type = type;
return this;
}
/**
* <p>Sets the Custom Fields fields for the <code>shippingAddress</code>.</p>
*/
public CartSetShippingCustomTypeActionBuilder fields(
Function<com.commercetools.api.models.type.FieldContainerBuilder, com.commercetools.api.models.type.FieldContainerBuilder> builder) {
this.fields = builder.apply(com.commercetools.api.models.type.FieldContainerBuilder.of()).build();
return this;
}
/**
* <p>Sets the Custom Fields fields for the <code>shippingAddress</code>.</p>
*/
public CartSetShippingCustomTypeActionBuilder fields(
@Nullable final com.commercetools.api.models.type.FieldContainer fields) {
this.fields = fields;
return this;
}
@Nullable
public String getShippingKey() {
return this.shippingKey;
}
@Nullable
public com.commercetools.api.models.type.TypeResourceIdentifier getType() {
return this.type;
}
@Nullable
public com.commercetools.api.models.type.FieldContainer getFields() {
return this.fields;
}
public CartSetShippingCustomTypeAction build() {
return new CartSetShippingCustomTypeActionImpl(shippingKey, type, fields);
}
/**
* builds CartSetShippingCustomTypeAction without checking for non null required values
*/
public CartSetShippingCustomTypeAction buildUnchecked() {
return new CartSetShippingCustomTypeActionImpl(shippingKey, type, fields);
}
public static CartSetShippingCustomTypeActionBuilder of() {
return new CartSetShippingCustomTypeActionBuilder();
}
public static CartSetShippingCustomTypeActionBuilder of(final CartSetShippingCustomTypeAction template) {
CartSetShippingCustomTypeActionBuilder builder = new CartSetShippingCustomTypeActionBuilder();
builder.shippingKey = template.getShippingKey();
builder.type = template.getType();
builder.fields = template.getFields();
return builder;
}
}