Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sdk-generation-log/balanceplatform.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"service": "balanceplatform",
"project": "java",
"generatedAt": "2026-07-21T12:28:58Z",
"openapiCommitSha": "c2ff0637d25d1c34aa1b19113e1b4e5eaa289960",
"generatedAt": "2026-07-23T13:25:41Z",
"openapiCommitSha": "06d031500a5565d326553c6b0d14c3c79d13a1eb",
"automationCommitSha": "0c108bd8050cf480d2710b78b770afdfbdd89397",
"libraryCommitSha": "5ff17f11a78b035f0dd862e1157bec9e026adcf1"
"libraryCommitSha": "7f01d8c3c98591abf7cf85a4db7b7ff76aa7e66b"
}
234 changes: 234 additions & 0 deletions src/main/java/com/adyen/model/balanceplatform/AmountDTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
/*
* Configuration API
*
* The version of the OpenAPI document: 2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package com.adyen.model.balanceplatform;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.*;

/** AmountDTO */
@JsonPropertyOrder({AmountDTO.JSON_PROPERTY_CURRENCY, AmountDTO.JSON_PROPERTY_VALUE})
public class AmountDTO {
public static final String JSON_PROPERTY_CURRENCY = "currency";
private String currency;

/** Mark when the attribute has been explicitly set. */
private boolean isSetCurrency = false;

public static final String JSON_PROPERTY_VALUE = "value";
private Long value;

/** Mark when the attribute has been explicitly set. */
private boolean isSetValue = false;

/**
* Sets whether attributes with null values should be explicitly included in the JSON payload.
* Default is false.
*/
@JsonIgnore private boolean includeNullValues = false;

public AmountDTO() {}

Check failure on line 43 in src/main/java/com/adyen/model/balanceplatform/AmountDTO.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-java-api-library&issues=AZ-PKtO7TtGT8hWgY6ao&open=AZ-PKtO7TtGT8hWgY6ao&pullRequest=2016

/**
* The three-character [ISO currency
* code](https://docs.adyen.com/development-resources/currency-codes).
*
* @param currency The three-character [ISO currency
* code](https://docs.adyen.com/development-resources/currency-codes).
* @return the current {@code AmountDTO} instance, allowing for method chaining
*/
public AmountDTO currency(String currency) {
this.currency = currency;
isSetCurrency = true; // mark as set
return this;
}

/**
* The three-character [ISO currency
* code](https://docs.adyen.com/development-resources/currency-codes).
*
* @return currency The three-character [ISO currency
* code](https://docs.adyen.com/development-resources/currency-codes).
*/
@JsonProperty(JSON_PROPERTY_CURRENCY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getCurrency() {
return currency;
}

/**
* The three-character [ISO currency
* code](https://docs.adyen.com/development-resources/currency-codes).
*
* @param currency The three-character [ISO currency
* code](https://docs.adyen.com/development-resources/currency-codes).
*/
@JsonProperty(JSON_PROPERTY_CURRENCY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setCurrency(String currency) {
this.currency = currency;
isSetCurrency = true; // mark as set
}

/**
* The amount of the transaction, in [minor
* units](https://docs.adyen.com/development-resources/currency-codes).
*
* @param value The amount of the transaction, in [minor
* units](https://docs.adyen.com/development-resources/currency-codes).
* @return the current {@code AmountDTO} instance, allowing for method chaining
*/
public AmountDTO value(Long value) {
this.value = value;
isSetValue = true; // mark as set
return this;
}

/**
* The amount of the transaction, in [minor
* units](https://docs.adyen.com/development-resources/currency-codes).
*
* @return value The amount of the transaction, in [minor
* units](https://docs.adyen.com/development-resources/currency-codes).
*/
@JsonProperty(JSON_PROPERTY_VALUE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getValue() {
return value;
}

/**
* The amount of the transaction, in [minor
* units](https://docs.adyen.com/development-resources/currency-codes).
*
* @param value The amount of the transaction, in [minor
* units](https://docs.adyen.com/development-resources/currency-codes).
*/
@JsonProperty(JSON_PROPERTY_VALUE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setValue(Long value) {
this.value = value;
isSetValue = true; // mark as set
}

/**
* Configures whether null values are explicitly serialized in the JSON payload. Default is false.
*/
public AmountDTO includeNullValues(boolean includeNullValues) {
this.includeNullValues = includeNullValues;
return this;
}

/** Returns whether null values are explicitly serialized in the JSON payload. */
public boolean isIncludeNullValues() {
return includeNullValues;
}

/**
* Sets whether null values should be explicitly serialized in the JSON payload. Default is false.
*/
public void setIncludeNullValues(boolean includeNullValues) {
this.includeNullValues = includeNullValues;
}

/** Return true if this AmountDTO object is equal to o. */
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AmountDTO amountDTO = (AmountDTO) o;
return Objects.equals(this.currency, amountDTO.currency)
&& Objects.equals(this.isSetCurrency, amountDTO.isSetCurrency)
&& Objects.equals(this.value, amountDTO.value)
&& Objects.equals(this.isSetValue, amountDTO.isSetValue);
}
Comment on lines +158 to +161

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using Objects.equals on primitive boolean fields like isSetCurrency and isSetValue causes unnecessary boxing to Boolean objects. For primitive fields, direct comparison using == is more efficient and idiomatic in Java.

    return Objects.equals(this.currency, amountDTO.currency)
        && this.isSetCurrency == amountDTO.isSetCurrency
        && Objects.equals(this.value, amountDTO.value)
        && this.isSetValue == amountDTO.isSetValue;


@Override
public int hashCode() {
return Objects.hash(currency, isSetCurrency, value, isSetValue);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AmountDTO {\n");
sb.append(" currency: ").append(toIndentedString(currency)).append("\n");
sb.append(" value: ").append(toIndentedString(value)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}

/** Returns a map of properties to be merged into the JSON payload as explicit null values. */
@JsonInclude(JsonInclude.Include.ALWAYS)
@JsonAnyGetter
public Map<String, Object> getExplicitNulls() {
if (!this.includeNullValues) {
return Collections.emptyMap();
}

Map<String, Object> nulls = new HashMap<>();

if (isSetCurrency) {
addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency);
}
if (isSetValue) {
addIfNull(nulls, JSON_PROPERTY_VALUE, this.value);
}

return nulls;
}

// add to map when value is null
private void addIfNull(Map<String, Object> map, String key, Object value) {
if (value == null) {
map.put(key, null);
}
}

/**
* Create an instance of AmountDTO given an JSON string
*
* @param jsonString JSON string
* @return An instance of AmountDTO
* @throws JsonProcessingException if the JSON string is invalid with respect to AmountDTO
*/
public static AmountDTO fromJson(String jsonString) throws JsonProcessingException {
return JSON.getMapper().readValue(jsonString, AmountDTO.class);
}

/**
* Convert an instance of AmountDTO to an JSON string
*
* @return JSON string
*/
public String toJson() throws JsonProcessingException {
return JSON.getMapper().writeValueAsString(this);
}
}
Loading