openapitools.model.WeirdParent Maven / Gradle / Ivy
The newest version!
/*
* 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 com.fasterxml.jackson.annotation.JsonPropertyOrder;
import openapitools.JSON;
/**
* WeirdParent
*/
@JsonPropertyOrder({
WeirdParent.JSON_PROPERTY_OBJECT_TYPE,
WeirdParent.JSON_PROPERTY_SOME_PROPERTY,
WeirdParent.JSON_PROPERTY_COMPLEX_BOOKING,
WeirdParent.JSON_PROPERTY_COMPLEX_BOOKINGS
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.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 = WeirdBooking.class, name = "WeirdBooking"),
})
public class WeirdParent {
public static final String JSON_PROPERTY_OBJECT_TYPE = "objectType";
private String objectType;
public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty";
private String someProperty;
public static final String JSON_PROPERTY_COMPLEX_BOOKING = "complexBooking";
private String complexBooking;
public static final String JSON_PROPERTY_COMPLEX_BOOKINGS = "complexBookings";
private List complexBookings = new ArrayList<>();
public WeirdParent() {
}
public WeirdParent objectType(String objectType) {
this.objectType = objectType;
return this;
}
/**
* Attribute is used as discriminator for inheritance between data types.
* @return objectType
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_OBJECT_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getObjectType() {
return objectType;
}
@JsonProperty(JSON_PROPERTY_OBJECT_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setObjectType(String objectType) {
this.objectType = objectType;
}
public WeirdParent someProperty(String someProperty) {
this.someProperty = someProperty;
return this;
}
/**
* Get someProperty
* @return someProperty
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_SOME_PROPERTY)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getSomeProperty() {
return someProperty;
}
@JsonProperty(JSON_PROPERTY_SOME_PROPERTY)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setSomeProperty(String someProperty) {
this.someProperty = someProperty;
}
public WeirdParent complexBooking(String complexBooking) {
this.complexBooking = complexBooking;
return this;
}
/**
* Internal ID 2nd line 3rd line
* @return complexBooking
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_COMPLEX_BOOKING)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getComplexBooking() {
return complexBooking;
}
@JsonProperty(JSON_PROPERTY_COMPLEX_BOOKING)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setComplexBooking(String complexBooking) {
this.complexBooking = complexBooking;
}
public WeirdParent complexBookings(List complexBookings) {
this.complexBookings = complexBookings;
return this;
}
public WeirdParent addComplexBookingsItem(String complexBookingsItem) {
if (this.complexBookings == null) {
this.complexBookings = new ArrayList<>();
}
this.complexBookings.add(complexBookingsItem);
return this;
}
/**
* Internal ID 2nd line 3rd line
* @return complexBookings
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_COMPLEX_BOOKINGS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List getComplexBookings() {
return complexBookings;
}
@JsonProperty(JSON_PROPERTY_COMPLEX_BOOKINGS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setComplexBookings(List complexBookings) {
this.complexBookings = complexBookings;
}
/**
* Return true if this WeirdParent object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WeirdParent weirdParent = (WeirdParent) o;
return Objects.equals(this.objectType, weirdParent.objectType) &&
Objects.equals(this.someProperty, weirdParent.someProperty) &&
Objects.equals(this.complexBooking, weirdParent.complexBooking) &&
Objects.equals(this.complexBookings, weirdParent.complexBookings);
}
@Override
public int hashCode() {
return Objects.hash(objectType, someProperty, complexBooking, complexBookings);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class WeirdParent {\n");
sb.append(" objectType: ").append(toIndentedString(objectType)).append("\n");
sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n");
sb.append(" complexBooking: ").append(toIndentedString(complexBooking)).append("\n");
sb.append(" complexBookings: ").append(toIndentedString(complexBookings)).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("WeirdBooking", WeirdBooking.class);
mappings.put("WeirdParent", WeirdParent.class);
JSON.registerDiscriminator(WeirdParent.class, "objectType", mappings);
}
}