• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Adyen / adyen-java-api-library / #3208

05 Apr 2024 12:25PM UTC coverage: 12.289%. First build
#3208

push

web-flow
Merge 63ea3061b into 0e4330fd3

19 of 150 new or added lines in 6 files covered. (12.67%)

12464 of 101425 relevant lines covered (12.29%)

0.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/adyen/model/checkout/InstallmentOption.java
1
/*
2
 * Adyen Checkout API
3
 *
4
 * The version of the OpenAPI document: 71
5
 * 
6
 *
7
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8
 * https://openapi-generator.tech
9
 * Do not edit the class manually.
10
 */
11

12

13
package com.adyen.model.checkout;
14

15
import java.util.Objects;
16
import java.util.Arrays;
17
import java.util.Map;
18
import java.util.HashMap;
19
import com.fasterxml.jackson.annotation.JsonInclude;
20
import com.fasterxml.jackson.annotation.JsonProperty;
21
import com.fasterxml.jackson.annotation.JsonCreator;
22
import com.fasterxml.jackson.annotation.JsonTypeName;
23
import com.fasterxml.jackson.annotation.JsonValue;
24
import io.swagger.annotations.ApiModel;
25
import io.swagger.annotations.ApiModelProperty;
26
import java.util.ArrayList;
27
import java.util.List;
28
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
29
import com.fasterxml.jackson.core.JsonProcessingException;
30

31

32
/**
33
 * InstallmentOption
34
 */
35
@JsonPropertyOrder({
36
  InstallmentOption.JSON_PROPERTY_MAX_VALUE,
37
  InstallmentOption.JSON_PROPERTY_PLANS,
38
  InstallmentOption.JSON_PROPERTY_PRESELECTED_VALUE,
39
  InstallmentOption.JSON_PROPERTY_VALUES
40
})
41

42
public class InstallmentOption {
43
  public static final String JSON_PROPERTY_MAX_VALUE = "maxValue";
44
  private Integer maxValue;
45

46
  /**
47
   * Gets or Sets plans
48
   */
49
  public enum PlansEnum {
×
NEW
50
    BUYNOW_PAYLATER("buynow_paylater"),
×
51
    
NEW
52
    INTERES_REFUND_PRCTG("interes_refund_prctg"),
×
53
    
NEW
54
    INTEREST_BONUS("interest_bonus"),
×
55
    
NEW
56
    NOINTERES_REFUND_PRCTG("nointeres_refund_prctg"),
×
57
    
NEW
58
    NOINTEREST_BONUS("nointerest_bonus"),
×
59
    
NEW
60
    REFUND_PRCTG("refund_prctg"),
×
61
    
62
    REGULAR("regular"),
×
63
    
NEW
64
    REVOLVING("revolving"),
×
65
    
NEW
66
    WITH_INTEREST("with_interest");
×
67

68
    private String value;
69

70
    PlansEnum(String value) {
×
71
      this.value = value;
×
72
    }
×
73

74
    @JsonValue
75
    public String getValue() {
76
      return value;
×
77
    }
78

79
    @Override
80
    public String toString() {
81
      return String.valueOf(value);
×
82
    }
83

84
    @JsonCreator
85
    public static PlansEnum fromValue(String value) {
86
      for (PlansEnum b : PlansEnum.values()) {
×
87
        if (b.value.equals(value)) {
×
88
          return b;
×
89
        }
90
      }
91
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
×
92
    }
93
  }
94

95
  public static final String JSON_PROPERTY_PLANS = "plans";
96
  private List<PlansEnum> plans = null;
×
97

98
  public static final String JSON_PROPERTY_PRESELECTED_VALUE = "preselectedValue";
99
  private Integer preselectedValue;
100

101
  public static final String JSON_PROPERTY_VALUES = "values";
102
  private List<Integer> values = null;
×
103

104
  public InstallmentOption() { 
×
105
  }
×
106

107
  public InstallmentOption maxValue(Integer maxValue) {
108
    this.maxValue = maxValue;
×
109
    return this;
×
110
  }
111

112
   /**
113
   * The maximum number of installments offered for this payment method.
114
   * @return maxValue
115
  **/
116
  @ApiModelProperty(value = "The maximum number of installments offered for this payment method.")
117
  @JsonProperty(JSON_PROPERTY_MAX_VALUE)
118
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
119

120
  public Integer getMaxValue() {
121
    return maxValue;
×
122
  }
123

124

125
 /**
126
  * The maximum number of installments offered for this payment method.
127
  *
128
  * @param maxValue
129
  */ 
130
  @JsonProperty(JSON_PROPERTY_MAX_VALUE)
131
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
132
  public void setMaxValue(Integer maxValue) {
133
    this.maxValue = maxValue;
×
134
  }
×
135

136

137
  public InstallmentOption plans(List<PlansEnum> plans) {
138
    this.plans = plans;
×
139
    return this;
×
140
  }
141

142
  public InstallmentOption addPlansItem(PlansEnum plansItem) {
143
    if (this.plans == null) {
×
144
      this.plans = new ArrayList<>();
×
145
    }
146
    this.plans.add(plansItem);
×
147
    return this;
×
148
  }
149

150
   /**
151
   * Defines the type of installment plan. If not set, defaults to **regular**.  Possible values: * **regular** * **revolving**
152
   * @return plans
153
  **/
154
  @ApiModelProperty(value = "Defines the type of installment plan. If not set, defaults to **regular**.  Possible values: * **regular** * **revolving**")
155
  @JsonProperty(JSON_PROPERTY_PLANS)
156
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
157

158
  public List<PlansEnum> getPlans() {
159
    return plans;
×
160
  }
161

162

163
 /**
164
  * Defines the type of installment plan. If not set, defaults to **regular**.  Possible values: * **regular** * **revolving**
165
  *
166
  * @param plans
167
  */ 
168
  @JsonProperty(JSON_PROPERTY_PLANS)
169
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
170
  public void setPlans(List<PlansEnum> plans) {
171
    this.plans = plans;
×
172
  }
×
173

174

175
  public InstallmentOption preselectedValue(Integer preselectedValue) {
176
    this.preselectedValue = preselectedValue;
×
177
    return this;
×
178
  }
179

180
   /**
181
   * Preselected number of installments offered for this payment method.
182
   * @return preselectedValue
183
  **/
184
  @ApiModelProperty(value = "Preselected number of installments offered for this payment method.")
185
  @JsonProperty(JSON_PROPERTY_PRESELECTED_VALUE)
186
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
187

188
  public Integer getPreselectedValue() {
189
    return preselectedValue;
×
190
  }
191

192

193
 /**
194
  * Preselected number of installments offered for this payment method.
195
  *
196
  * @param preselectedValue
197
  */ 
198
  @JsonProperty(JSON_PROPERTY_PRESELECTED_VALUE)
199
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
200
  public void setPreselectedValue(Integer preselectedValue) {
201
    this.preselectedValue = preselectedValue;
×
202
  }
×
203

204

205
  public InstallmentOption values(List<Integer> values) {
206
    this.values = values;
×
207
    return this;
×
208
  }
209

210
  public InstallmentOption addValuesItem(Integer valuesItem) {
211
    if (this.values == null) {
×
212
      this.values = new ArrayList<>();
×
213
    }
214
    this.values.add(valuesItem);
×
215
    return this;
×
216
  }
217

218
   /**
219
   * An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with &#x60;maxValue&#x60;.
220
   * @return values
221
  **/
222
  @ApiModelProperty(value = "An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`.")
223
  @JsonProperty(JSON_PROPERTY_VALUES)
224
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
225

226
  public List<Integer> getValues() {
227
    return values;
×
228
  }
229

230

231
 /**
232
  * An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with &#x60;maxValue&#x60;.
233
  *
234
  * @param values
235
  */ 
236
  @JsonProperty(JSON_PROPERTY_VALUES)
237
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
238
  public void setValues(List<Integer> values) {
239
    this.values = values;
×
240
  }
×
241

242

243
  /**
244
   * Return true if this InstallmentOption object is equal to o.
245
   */
246
  @Override
247
  public boolean equals(Object o) {
248
    if (this == o) {
×
249
      return true;
×
250
    }
251
    if (o == null || getClass() != o.getClass()) {
×
252
      return false;
×
253
    }
254
    InstallmentOption installmentOption = (InstallmentOption) o;
×
255
    return Objects.equals(this.maxValue, installmentOption.maxValue) &&
×
256
        Objects.equals(this.plans, installmentOption.plans) &&
×
257
        Objects.equals(this.preselectedValue, installmentOption.preselectedValue) &&
×
258
        Objects.equals(this.values, installmentOption.values);
×
259
  }
260

261
  @Override
262
  public int hashCode() {
263
    return Objects.hash(maxValue, plans, preselectedValue, values);
×
264
  }
265

266
  @Override
267
  public String toString() {
268
    StringBuilder sb = new StringBuilder();
×
269
    sb.append("class InstallmentOption {\n");
×
270
    sb.append("    maxValue: ").append(toIndentedString(maxValue)).append("\n");
×
271
    sb.append("    plans: ").append(toIndentedString(plans)).append("\n");
×
272
    sb.append("    preselectedValue: ").append(toIndentedString(preselectedValue)).append("\n");
×
273
    sb.append("    values: ").append(toIndentedString(values)).append("\n");
×
274
    sb.append("}");
×
275
    return sb.toString();
×
276
  }
277

278
  /**
279
   * Convert the given object to string with each line indented by 4 spaces
280
   * (except the first line).
281
   */
282
  private String toIndentedString(Object o) {
283
    if (o == null) {
×
284
      return "null";
×
285
    }
286
    return o.toString().replace("\n", "\n    ");
×
287
  }
288

289
/**
290
   * Create an instance of InstallmentOption given an JSON string
291
   *
292
   * @param jsonString JSON string
293
   * @return An instance of InstallmentOption
294
   * @throws JsonProcessingException if the JSON string is invalid with respect to InstallmentOption
295
   */
296
  public static InstallmentOption fromJson(String jsonString) throws JsonProcessingException {
297
    return JSON.getMapper().readValue(jsonString, InstallmentOption.class);
×
298
  }
299
/**
300
  * Convert an instance of InstallmentOption to an JSON string
301
  *
302
  * @return JSON string
303
  */
304
  public String toJson() throws JsonProcessingException {
305
    return JSON.getMapper().writeValueAsString(this);
×
306
  }
307
}
308

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc