openapitools.model.WeirdBooking 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 openapitools.model.Booking;
import openapitools.model.InventoryType;
import openapitools.model.WeirdParent;
import org.openapitools.jackson.nullable.JsonNullable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import openapitools.JSON;
/**
* WeirdBooking
*/
@JsonPropertyOrder({
WeirdBooking.JSON_PROPERTY_BOOKING,
WeirdBooking.JSON_PROPERTY_ADDITIONAL_BOOKINGS,
WeirdBooking.JSON_PROPERTY_VERSIONED_OBJECT_SOFT_LINK,
WeirdBooking.JSON_PROPERTY_CHILD_PROPERTY,
WeirdBooking.JSON_PROPERTY_REAL_BOOKING,
WeirdBooking.JSON_PROPERTY_INVENTORIES
})
@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)
public class WeirdBooking extends WeirdParent {
public static final String JSON_PROPERTY_BOOKING = "booking";
private String booking;
public static final String JSON_PROPERTY_ADDITIONAL_BOOKINGS = "additionalBookings";
private JsonNullable> additionalBookings = JsonNullable.>undefined();
public static final String JSON_PROPERTY_VERSIONED_OBJECT_SOFT_LINK = "versionedObjectSoftLink";
private String versionedObjectSoftLink;
public static final String JSON_PROPERTY_CHILD_PROPERTY = "childProperty";
private Integer childProperty;
public static final String JSON_PROPERTY_REAL_BOOKING = "realBooking";
private Booking realBooking;
public static final String JSON_PROPERTY_INVENTORIES = "inventories";
private List inventories = new ArrayList<>();
public WeirdBooking() {
}
public WeirdBooking booking(String booking) {
this.booking = booking;
return this;
}
/**
* Internal ID 2nd line 3rd line
* @return booking
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_BOOKING)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getBooking() {
return booking;
}
@JsonProperty(JSON_PROPERTY_BOOKING)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setBooking(String booking) {
this.booking = booking;
}
public WeirdBooking additionalBookings(List additionalBookings) {
this.additionalBookings = JsonNullable.>of(additionalBookings);
return this;
}
public WeirdBooking addAdditionalBookingsItem(String additionalBookingsItem) {
if (this.additionalBookings == null || !this.additionalBookings.isPresent()) {
this.additionalBookings = JsonNullable.>of(new ArrayList<>());
}
try {
this.additionalBookings.get().add(additionalBookingsItem);
} catch (java.util.NoSuchElementException e) {
// this can never happen, as we make sure above that the value is present
}
return this;
}
/**
* additional bookings
* @return additionalBookings
*/
@javax.annotation.Nullable
@JsonIgnore
public List getAdditionalBookings() {
return additionalBookings.orElse(null);
}
@JsonProperty(JSON_PROPERTY_ADDITIONAL_BOOKINGS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable> getAdditionalBookings_JsonNullable() {
return additionalBookings;
}
@JsonProperty(JSON_PROPERTY_ADDITIONAL_BOOKINGS)
public void setAdditionalBookings_JsonNullable(JsonNullable> additionalBookings) {
this.additionalBookings = additionalBookings;
}
public void setAdditionalBookings(List additionalBookings) {
this.additionalBookings = JsonNullable.>of(additionalBookings);
}
public WeirdBooking versionedObjectSoftLink(String versionedObjectSoftLink) {
this.versionedObjectSoftLink = versionedObjectSoftLink;
return this;
}
/**
* soft link 2nd line 3rd line
* @return versionedObjectSoftLink
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_VERSIONED_OBJECT_SOFT_LINK)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getVersionedObjectSoftLink() {
return versionedObjectSoftLink;
}
@JsonProperty(JSON_PROPERTY_VERSIONED_OBJECT_SOFT_LINK)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setVersionedObjectSoftLink(String versionedObjectSoftLink) {
this.versionedObjectSoftLink = versionedObjectSoftLink;
}
public WeirdBooking childProperty(Integer childProperty) {
this.childProperty = childProperty;
return this;
}
/**
* Get childProperty
* @return childProperty
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_CHILD_PROPERTY)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public Integer getChildProperty() {
return childProperty;
}
@JsonProperty(JSON_PROPERTY_CHILD_PROPERTY)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setChildProperty(Integer childProperty) {
this.childProperty = childProperty;
}
public WeirdBooking realBooking(Booking realBooking) {
this.realBooking = realBooking;
return this;
}
/**
* Get realBooking
* @return realBooking
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_REAL_BOOKING)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Booking getRealBooking() {
return realBooking;
}
@JsonProperty(JSON_PROPERTY_REAL_BOOKING)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setRealBooking(Booking realBooking) {
this.realBooking = realBooking;
}
public WeirdBooking inventories(List inventories) {
this.inventories = inventories;
return this;
}
public WeirdBooking addInventoriesItem(InventoryType inventoriesItem) {
if (this.inventories == null) {
this.inventories = new ArrayList<>();
}
this.inventories.add(inventoriesItem);
return this;
}
/**
* <br><br> Breaking Change with 2.1: Association will required at least 1 object.
* @return inventories
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_INVENTORIES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List getInventories() {
return inventories;
}
@JsonProperty(JSON_PROPERTY_INVENTORIES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setInventories(List inventories) {
this.inventories = inventories;
}
/**
* Return true if this WeirdBooking object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WeirdBooking weirdBooking = (WeirdBooking) o;
return Objects.equals(this.booking, weirdBooking.booking) &&
equalsNullable(this.additionalBookings, weirdBooking.additionalBookings) &&
Objects.equals(this.versionedObjectSoftLink, weirdBooking.versionedObjectSoftLink) &&
Objects.equals(this.childProperty, weirdBooking.childProperty) &&
Objects.equals(this.realBooking, weirdBooking.realBooking) &&
Objects.equals(this.inventories, weirdBooking.inventories) &&
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(booking, hashCodeNullable(additionalBookings), versionedObjectSoftLink, childProperty, realBooking, inventories, 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 WeirdBooking {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" booking: ").append(toIndentedString(booking)).append("\n");
sb.append(" additionalBookings: ").append(toIndentedString(additionalBookings)).append("\n");
sb.append(" versionedObjectSoftLink: ").append(toIndentedString(versionedObjectSoftLink)).append("\n");
sb.append(" childProperty: ").append(toIndentedString(childProperty)).append("\n");
sb.append(" realBooking: ").append(toIndentedString(realBooking)).append("\n");
sb.append(" inventories: ").append(toIndentedString(inventories)).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);
JSON.registerDiscriminator(WeirdBooking.class, "objectType", mappings);
}
}