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/documentcollector.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"service": "documentcollector",
"project": "java",
"generatedAt": "2026-08-21T14:02:13Z",
"openapiCommitSha": "bee086f2cd666ac7cb5b5ba2813a8b5dc943c2d2",
"automationCommitSha": "8d09e0f762f7b00c707748d84d0d002964410c0f",
"libraryCommitSha": "bca8a14bd8bfd031e109bbf12684150f37b17a2b"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/*
* Cross-border Invoices API
*
* The version of the OpenAPI document: 1
*
*
* 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.documentcollector;

import com.fasterxml.jackson.annotation.JsonValue;
import jakarta.ws.rs.core.GenericType;
import java.util.Map;
import java.util.Objects;

/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */
public abstract class AbstractOpenApiSchema {

// store the actual instance of the schema/object
private Object instance;

// is nullable
private Boolean isNullable;

// schema type (e.g. oneOf, anyOf)
private final String schemaType;

/**
* @param schemaType the schema type
* @param isNullable whether the instance is nullable
*/
public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {

Check warning on line 35 in src/main/java/com/adyen/model/documentcollector/AbstractOpenApiSchema.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Change the visibility of this constructor to "protected".

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-java-api-library&issues=AaAkpQBB8nQQYZfl8VYV&open=AaAkpQBB8nQQYZfl8VYV&pullRequest=2045
this.schemaType = schemaType;
this.isNullable = isNullable;
}

/**
* Get the list of oneOf/anyOf composed schemas allowed to be stored in this object
*
* @return an instance of the actual schema/object
*/
public abstract Map<String, GenericType<?>> getSchemas();

/**
* Get the actual instance
*
* @return an instance of the actual schema/object
*/
@JsonValue
public Object getActualInstance() {
return instance;
}

/**
* Set the actual instance
*
* @param instance the actual instance of the schema/object
*/
public void setActualInstance(Object instance) {
this.instance = instance;
}

/**
* Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf
* schema as well
*
* @return an instance of the actual schema/object
*/
public Object getActualInstanceRecursively() {
return getActualInstanceRecursively(this);
}

private Object getActualInstanceRecursively(AbstractOpenApiSchema object) {
if (object.getActualInstance() == null) {
return null;
} else if (object.getActualInstance() instanceof AbstractOpenApiSchema) {
return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance());
} else {
return object.getActualInstance();
}
}

/**
* Get the schema type (e.g. anyOf, oneOf)
*
* @return the schema type
*/
public String getSchemaType() {
return schemaType;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ").append(getClass()).append(" {\n");
sb.append(" instance: ").append(toIndentedString(instance)).append("\n");
sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n");
sb.append(" schemaType: ").append(toIndentedString(schemaType)).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 ");
}

public boolean equals(Object o) {

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 equals method overrides Object.equals but is missing the @Override annotation. Adding @Override is a best practice that improves readability and allows the compiler to catch errors if the method signature is accidentally changed.

Suggested change
public boolean equals(Object o) {
@Override\n public boolean equals(Object o) {

if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AbstractOpenApiSchema a = (AbstractOpenApiSchema) o;
return Objects.equals(this.instance, a.instance)
&& Objects.equals(this.isNullable, a.isNullable)
&& Objects.equals(this.schemaType, a.schemaType);
}

@Override
public int hashCode() {
return Objects.hash(instance, isNullable, schemaType);
}

/**
* Is nullable
*
* @return true if it's nullable
*/
public Boolean isNullable() {
return Boolean.TRUE.equals(isNullable);
}
}
Loading