openapitools.model.ChildA Maven / Gradle / Ivy
/*
* Product Base Definitions
* This component represents the Open API interface of the accounting service.
*
* The version of the OpenAPI document: 0.0.1
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package openapitools.model;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import openapitools.model.BankAccount;
import openapitools.model.ParentClass;
import org.openapitools.jackson.nullable.JsonNullable;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import openapitools.JSON;
/**
* single line class comment
*/
@JsonPropertyOrder({
ChildA.JSON_PROPERTY_CHILD_A_ATTRIBUTE
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0")
@JsonIgnoreProperties(
value = "objectType", // ignore manually set objectType, it will be automatically generated by Jackson during serialization
allowSetters = true // allows the objectType to be set during deserialization
)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = ChildAA.class, name = "ChildAA"),
})
public class ChildA extends ParentClass {
public static final String JSON_PROPERTY_CHILD_A_ATTRIBUTE = "childAAttribute";
private Integer childAAttribute;
public ChildA() {
}
public ChildA childAAttribute(Integer childAAttribute) {
this.childAAttribute = childAAttribute;
return this;
}
/**
* Get childAAttribute
* @return childAAttribute
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_CHILD_A_ATTRIBUTE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public Integer getChildAAttribute() {
return childAAttribute;
}
@JsonProperty(JSON_PROPERTY_CHILD_A_ATTRIBUTE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setChildAAttribute(Integer childAAttribute) {
this.childAAttribute = childAAttribute;
}
/**
* Return true if this ChildA object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ChildA childA = (ChildA) o;
return Objects.equals(this.childAAttribute, childA.childAAttribute) &&
super.equals(o);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(childAAttribute, super.hashCode());
}
private static int hashCodeNullable(JsonNullable a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ChildA {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" childAAttribute: ").append(toIndentedString(childAAttribute)).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 ");
}
static {
// Initialize and register the discriminator mappings.
Map> mappings = new HashMap<>();
mappings.put("ChildAA", ChildAA.class);
mappings.put("ChildA", ChildA.class);
JSON.registerDiscriminator(ChildA.class, "objectType", mappings);
}
}