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

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

07 Aug 2024 01:54PM UTC coverage: 11.85%. First build
#3406

push

web-flow
Merge e17893d63 into 4d76e33cf

5 of 744 new or added lines in 34 files covered. (0.67%)

12525 of 105697 relevant lines covered (11.85%)

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/Amounts.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
 * Amounts
34
 */
35
@JsonPropertyOrder({
36
  Amounts.JSON_PROPERTY_CURRENCY,
37
  Amounts.JSON_PROPERTY_VALUES
38
})
39

40
public class Amounts {
41
  public static final String JSON_PROPERTY_CURRENCY = "currency";
42
  private String currency;
43

44
  public static final String JSON_PROPERTY_VALUES = "values";
NEW
45
  private List<Long> values = new ArrayList<>();
×
46

NEW
47
  public Amounts() { 
×
NEW
48
  }
×
49

50
  public Amounts currency(String currency) {
NEW
51
    this.currency = currency;
×
NEW
52
    return this;
×
53
  }
54

55
   /**
56
   * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).
57
   * @return currency
58
  **/
59
  @ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).")
60
  @JsonProperty(JSON_PROPERTY_CURRENCY)
61
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
62

63
  public String getCurrency() {
NEW
64
    return currency;
×
65
  }
66

67

68
 /**
69
  * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).
70
  *
71
  * @param currency
72
  */ 
73
  @JsonProperty(JSON_PROPERTY_CURRENCY)
74
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
75
  public void setCurrency(String currency) {
NEW
76
    this.currency = currency;
×
NEW
77
  }
×
78

79

80
  public Amounts values(List<Long> values) {
NEW
81
    this.values = values;
×
NEW
82
    return this;
×
83
  }
84

85
  public Amounts addValuesItem(Long valuesItem) {
NEW
86
    this.values.add(valuesItem);
×
NEW
87
    return this;
×
88
  }
89

90
   /**
91
   * The amounts of the donation (in [minor units](https://docs.adyen.com/development-resources/currency-codes/)).
92
   * @return values
93
  **/
94
  @ApiModelProperty(required = true, value = "The amounts of the donation (in [minor units](https://docs.adyen.com/development-resources/currency-codes/)).")
95
  @JsonProperty(JSON_PROPERTY_VALUES)
96
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
97

98
  public List<Long> getValues() {
NEW
99
    return values;
×
100
  }
101

102

103
 /**
104
  * The amounts of the donation (in [minor units](https://docs.adyen.com/development-resources/currency-codes/)).
105
  *
106
  * @param values
107
  */ 
108
  @JsonProperty(JSON_PROPERTY_VALUES)
109
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
110
  public void setValues(List<Long> values) {
NEW
111
    this.values = values;
×
NEW
112
  }
×
113

114

115
  /**
116
   * Return true if this Amounts object is equal to o.
117
   */
118
  @Override
119
  public boolean equals(Object o) {
NEW
120
    if (this == o) {
×
NEW
121
      return true;
×
122
    }
NEW
123
    if (o == null || getClass() != o.getClass()) {
×
NEW
124
      return false;
×
125
    }
NEW
126
    Amounts amounts = (Amounts) o;
×
NEW
127
    return Objects.equals(this.currency, amounts.currency) &&
×
NEW
128
        Objects.equals(this.values, amounts.values);
×
129
  }
130

131
  @Override
132
  public int hashCode() {
NEW
133
    return Objects.hash(currency, values);
×
134
  }
135

136
  @Override
137
  public String toString() {
NEW
138
    StringBuilder sb = new StringBuilder();
×
NEW
139
    sb.append("class Amounts {\n");
×
NEW
140
    sb.append("    currency: ").append(toIndentedString(currency)).append("\n");
×
NEW
141
    sb.append("    values: ").append(toIndentedString(values)).append("\n");
×
NEW
142
    sb.append("}");
×
NEW
143
    return sb.toString();
×
144
  }
145

146
  /**
147
   * Convert the given object to string with each line indented by 4 spaces
148
   * (except the first line).
149
   */
150
  private String toIndentedString(Object o) {
NEW
151
    if (o == null) {
×
NEW
152
      return "null";
×
153
    }
NEW
154
    return o.toString().replace("\n", "\n    ");
×
155
  }
156

157
/**
158
   * Create an instance of Amounts given an JSON string
159
   *
160
   * @param jsonString JSON string
161
   * @return An instance of Amounts
162
   * @throws JsonProcessingException if the JSON string is invalid with respect to Amounts
163
   */
164
  public static Amounts fromJson(String jsonString) throws JsonProcessingException {
NEW
165
    return JSON.getMapper().readValue(jsonString, Amounts.class);
×
166
  }
167
/**
168
  * Convert an instance of Amounts to an JSON string
169
  *
170
  * @return JSON string
171
  */
172
  public String toJson() throws JsonProcessingException {
NEW
173
    return JSON.getMapper().writeValueAsString(this);
×
174
  }
175
}
176

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