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
8 changes: 8 additions & 0 deletions sdk-generation-log/capital.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"service": "capital",
"project": "java",
"generatedAt": "2026-04-20T10:47:11Z",
"openapiCommitSha": "3550ecd3f320efaad6bee55ffed5122cb9ba09d5",
"automationCommitSha": "4ad0c0c7e87bc0e5994a9a3350a991d0691350bb",
"libraryCommitSha": "f6491265ec484f8de763b2bf915498ee30b42861"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@
package com.adyen.model.capital;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonCreator;
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.annotation.JsonValue;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.*;
import java.util.Arrays;
import java.util.logging.Logger;

/** AdditionalBankIdentification */
@JsonPropertyOrder({
Expand All @@ -31,8 +35,64 @@ public class AdditionalBankIdentification {
/** Mark when the attribute has been explicitly set. */
private boolean isSetCode = false;

/**
* The type of additional bank identification, depending on the country. Possible values: *
* **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB)
* code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. *
* **caRoutingNumber**: The 9-digit [Canadian routing
* number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without
* separators or spaces. * **gbSortCode**: The 6-digit [UK sort
* code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces *
* **usRoutingNumber**: The 9-digit [routing
* number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or
* spaces.
*/
public enum TypeEnum {
AUBSBCODE(String.valueOf("auBsbCode")),

CAROUTINGNUMBER(String.valueOf("caRoutingNumber")),

GBSORTCODE(String.valueOf("gbSortCode")),

USROUTINGNUMBER(String.valueOf("usRoutingNumber"));
Comment thread
gcatanese marked this conversation as resolved.

private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName());

private String value;

TypeEnum(String value) {
this.value = value;
}

@JsonValue
public String getValue() {
return value;
}

@Override
public String toString() {
return String.valueOf(value);
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

The String.valueOf() call is redundant since value is already a String. This can be simplified to return value;. This pattern is repeated in other enums in this PR.

Suggested change
return String.valueOf(value);
return value;

}

@JsonCreator
public static TypeEnum fromValue(String value) {
for (TypeEnum b : TypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
// handling unexpected value
LOG.warning(
"TypeEnum: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(TypeEnum.values()));
return null;
}
Comment on lines +78 to +91
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

The fromValue method uses a linear search over the enum values. For better performance, especially if the number of enum constants grows, consider using a static map for an O(1) lookup. This is a recurring pattern in other enums in this PR.

Example implementation:

private static final Map<String, TypeEnum> VALUE_MAP = new HashMap<>();

static {
    for (TypeEnum e : values()) {
        VALUE_MAP.put(e.value, e);
    }
}

@JsonCreator
public static TypeEnum fromValue(String value) {
    TypeEnum enumValue = VALUE_MAP.get(value);
    if (enumValue == null) {
        LOG.warning(
            "TypeEnum: unexpected enum value '" 
                + value 
                + "' - Supported values are " 
                + Arrays.toString(TypeEnum.values()));
    }
    return enumValue;
}

}

public static final String JSON_PROPERTY_TYPE = "type";
private AdditionalBankIdentificationTypes type;
private TypeEnum type;

/** Mark when the attribute has been explicitly set. */
private boolean isSetType = false;
Expand Down Expand Up @@ -81,36 +141,90 @@ public void setCode(String code) {
}

/**
* type
* The type of additional bank identification, depending on the country. Possible values: *
* **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB)
* code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. *
* **caRoutingNumber**: The 9-digit [Canadian routing
* number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without
* separators or spaces. * **gbSortCode**: The 6-digit [UK sort
* code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces *
* **usRoutingNumber**: The 9-digit [routing
* number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or
* spaces.
*
* @param type
* @param type The type of additional bank identification, depending on the country. Possible
* values: * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB)
* code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. *
* **caRoutingNumber**: The 9-digit [Canadian routing
* number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without
* separators or spaces. * **gbSortCode**: The 6-digit [UK sort
* code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces *
* **usRoutingNumber**: The 9-digit [routing
* number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or
* spaces.
Comment on lines +155 to +164
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

The Javadoc for the type parameter is a verbatim copy of the method's main description. This is redundant and makes the documentation harder to read. The parameter description should be more concise, for example: @param type The type of additional bank identification. This pattern of verbose and repetitive Javadoc is present for other methods and classes in this pull request.

* @return the current {@code AdditionalBankIdentification} instance, allowing for method chaining
*/
public AdditionalBankIdentification type(AdditionalBankIdentificationTypes type) {
public AdditionalBankIdentification type(TypeEnum type) {
this.type = type;
isSetType = true; // mark as set
return this;
}

/**
* Get type
* The type of additional bank identification, depending on the country. Possible values: *
* **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB)
* code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. *
* **caRoutingNumber**: The 9-digit [Canadian routing
* number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without
* separators or spaces. * **gbSortCode**: The 6-digit [UK sort
* code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces *
* **usRoutingNumber**: The 9-digit [routing
* number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or
* spaces.
*
* @return type
* @return type The type of additional bank identification, depending on the country. Possible
* values: * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB)
* code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. *
* **caRoutingNumber**: The 9-digit [Canadian routing
* number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without
* separators or spaces. * **gbSortCode**: The 6-digit [UK sort
* code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces *
* **usRoutingNumber**: The 9-digit [routing
* number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or
* spaces.
*/
@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public AdditionalBankIdentificationTypes getType() {
public TypeEnum getType() {
return type;
}

/**
* type
* The type of additional bank identification, depending on the country. Possible values: *
* **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB)
* code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. *
* **caRoutingNumber**: The 9-digit [Canadian routing
* number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without
* separators or spaces. * **gbSortCode**: The 6-digit [UK sort
* code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces *
* **usRoutingNumber**: The 9-digit [routing
* number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or
* spaces.
*
* @param type
* @param type The type of additional bank identification, depending on the country. Possible
* values: * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB)
* code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. *
* **caRoutingNumber**: The 9-digit [Canadian routing
* number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without
* separators or spaces. * **gbSortCode**: The 6-digit [UK sort
* code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces *
* **usRoutingNumber**: The 9-digit [routing
* number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or
* spaces.
*/
@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setType(AdditionalBankIdentificationTypes type) {
public void setType(TypeEnum type) {
this.type = type;
isSetType = true; // mark as set
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.*;
import java.util.logging.Logger;

/** Gets or Sets CALocalBankAccountType */
public enum CALocalBankAccountType {
CHECKING("checking"),

SAVINGS("savings");

private static final Logger LOG = Logger.getLogger(CALocalBankAccountType.class.getName());

private String value;

CALocalBankAccountType(String value) {
Expand All @@ -44,6 +47,12 @@ public static CALocalBankAccountType fromValue(String value) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
// handling unexpected value
LOG.warning(
"CALocalBankAccountType: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(CALocalBankAccountType.values()));
return null;
}
}
Loading
Loading