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

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

23 Oct 2023 03:04PM CUT coverage: 12.821%. First build
#2752

push

web-flow
Merge 1479c10ab into b96088175

12345 of 96286 relevant lines covered (12.82%)

0.13 hits per line

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

0.0
/src/main/java/com/adyen/model/acswebhooks/AbstractOpenApiSchema.java
1
/*
2
 * Authentication webhooks
3
 *
4
 * The version of the OpenAPI document: 1
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.acswebhooks;
14

15
import java.util.Objects;
16
import java.lang.reflect.Type;
17
import java.util.Map;
18
import jakarta.ws.rs.core.GenericType;
19

20
import com.fasterxml.jackson.annotation.JsonValue;
21

22
/**
23
 * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec
24
 */
25

26
public abstract class AbstractOpenApiSchema {
27

28
    // store the actual instance of the schema/object
29
    private Object instance;
30

31
    // is nullable
32
    private Boolean isNullable;
33

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

37
    public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
×
38
        this.schemaType = schemaType;
×
39
        this.isNullable = isNullable;
×
40
    }
×
41

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

49
    /**
50
     * Get the actual instance
51
     *
52
     * @return an instance of the actual schema/object
53
     */
54
    @JsonValue
55
    public Object getActualInstance() {return instance;}
×
56

57
    /**
58
     * Set the actual instance
59
     *
60
     * @param instance the actual instance of the schema/object
61
     */
62
    public void setActualInstance(Object instance) {this.instance = instance;}
×
63

64
    /**
65
     * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well
66
     *
67
     * @return an instance of the actual schema/object
68
     */
69
    public Object getActualInstanceRecursively() {
70
        return getActualInstanceRecursively(this);
×
71
    }
72

73
    private Object getActualInstanceRecursively(AbstractOpenApiSchema object) {
74
        if (object.getActualInstance() == null) {
×
75
            return null;
×
76
        } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) {
×
77
            return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance());
×
78
        } else {
79
            return object.getActualInstance();
×
80
        }
81
    }
82

83
    /**
84
     * Get the schema type (e.g. anyOf, oneOf)
85
     *
86
     * @return the schema type
87
     */
88
    public String getSchemaType() {
89
        return schemaType;
×
90
    }
91

92
    @Override
93
    public String toString() {
94
        StringBuilder sb = new StringBuilder();
×
95
        sb.append("class ").append(getClass()).append(" {\n");
×
96
        sb.append("    instance: ").append(toIndentedString(instance)).append("\n");
×
97
        sb.append("    isNullable: ").append(toIndentedString(isNullable)).append("\n");
×
98
        sb.append("    schemaType: ").append(toIndentedString(schemaType)).append("\n");
×
99
        sb.append("}");
×
100
        return sb.toString();
×
101
    }
102

103
    /**
104
     * Convert the given object to string with each line indented by 4 spaces
105
     * (except the first line).
106
     */
107
    private String toIndentedString(Object o) {
108
        if (o == null) {
×
109
            return "null";
×
110
        }
111
        return o.toString().replace("\n", "\n    ");
×
112
    }
113

114
    public boolean equals(Object o) {
115
        if (this == o) {
×
116
            return true;
×
117
        }
118
        if (o == null || getClass() != o.getClass()) {
×
119
            return false;
×
120
        }
121
        AbstractOpenApiSchema a = (AbstractOpenApiSchema) o;
×
122
        return Objects.equals(this.instance, a.instance) &&
×
123
            Objects.equals(this.isNullable, a.isNullable) &&
×
124
            Objects.equals(this.schemaType, a.schemaType);
×
125
    }
126

127
    @Override
128
    public int hashCode() {
129
        return Objects.hash(instance, isNullable, schemaType);
×
130
    }
131

132
    /**
133
     * Is nullable
134
     *
135
     * @return true if it's nullable
136
     */
137
    public Boolean isNullable() {
138
        if (Boolean.TRUE.equals(isNullable)) {
×
139
            return Boolean.TRUE;
×
140
        } else {
141
            return Boolean.FALSE;
×
142
        }
143
    }
144

145

146

147
}
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