All Downloads are FREE. Search and download functionalities are using the official Maven repository.

openapitools.model.POI 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.LinkObject;
import openapitools.model.Stop;
import openapitools.model.UICStop;
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;


/**
 * POI
 */
@JsonPropertyOrder({
  POI.JSON_PROPERTY_DESCRIPTION,
  POI.JSON_PROPERTY_THE_LINK_I_D,
  POI.JSON_PROPERTY_EVEN_MORE_LINK_I_DS,
  POI.JSON_PROPERTY_STOPS,
  POI.JSON_PROPERTY_BOOKING_CODES
})
@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 POI extends Stop {
  public static final String JSON_PROPERTY_DESCRIPTION = "description";
  private String description;

  public static final String JSON_PROPERTY_THE_LINK_I_D = "theLinkID";
  @Deprecated
  private Long theLinkID;

  public static final String JSON_PROPERTY_EVEN_MORE_LINK_I_DS = "evenMoreLinkIDs";
  @Deprecated
  private JsonNullable> evenMoreLinkIDs = JsonNullable.>undefined();

  public static final String JSON_PROPERTY_STOPS = "stops";
  private List stops = new ArrayList<>();

  public static final String JSON_PROPERTY_BOOKING_CODES = "bookingCodes";
  private List bookingCodes = new ArrayList<>();

  public POI() { 
  }

  public POI description(String description) {
    this.description = description;
    return this;
  }

  /**
   * Get description
   * @return description
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_DESCRIPTION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getDescription() {
    return description;
  }


  @JsonProperty(JSON_PROPERTY_DESCRIPTION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setDescription(String description) {
    this.description = description;
  }


  @Deprecated
  public POI theLinkID(Long theLinkID) {
    this.theLinkID = theLinkID;
    return this;
  }

  /**
   * Get theLinkID
   * @return theLinkID
   * @deprecated
   */
  @Deprecated
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_THE_LINK_I_D)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Long getTheLinkID() {
    return theLinkID;
  }


  @Deprecated
  @JsonProperty(JSON_PROPERTY_THE_LINK_I_D)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setTheLinkID(Long theLinkID) {
    this.theLinkID = theLinkID;
  }


  @Deprecated
  public POI evenMoreLinkIDs(List evenMoreLinkIDs) {
    this.evenMoreLinkIDs = JsonNullable.>of(evenMoreLinkIDs);
    return this;
  }

  public POI addEvenMoreLinkIDsItem(String evenMoreLinkIDsItem) {
    if (this.evenMoreLinkIDs == null || !this.evenMoreLinkIDs.isPresent()) {
      this.evenMoreLinkIDs = JsonNullable.>of(new ArrayList<>());
    }
    try {
      this.evenMoreLinkIDs.get().add(evenMoreLinkIDsItem);
    } catch (java.util.NoSuchElementException e) {
      // this can never happen, as we make sure above that the value is present
    }
    return this;
  }

  /**
   * Get evenMoreLinkIDs
   * @return evenMoreLinkIDs
   * @deprecated
   */
  @Deprecated
  @javax.annotation.Nullable
  @JsonIgnore

  public List getEvenMoreLinkIDs() {
        return evenMoreLinkIDs.orElse(null);
  }

  @JsonProperty(JSON_PROPERTY_EVEN_MORE_LINK_I_DS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public JsonNullable> getEvenMoreLinkIDs_JsonNullable() {
    return evenMoreLinkIDs;
  }
  
  @JsonProperty(JSON_PROPERTY_EVEN_MORE_LINK_I_DS)
  public void setEvenMoreLinkIDs_JsonNullable(JsonNullable> evenMoreLinkIDs) {
    this.evenMoreLinkIDs = evenMoreLinkIDs;
  }

  @Deprecated
  public void setEvenMoreLinkIDs(List evenMoreLinkIDs) {
    this.evenMoreLinkIDs = JsonNullable.>of(evenMoreLinkIDs);
  }


  public POI stops(List stops) {
    this.stops = stops;
    return this;
  }

  public POI addStopsItem(UICStop stopsItem) {
    if (this.stops == null) {
      this.stops = new ArrayList<>();
    }
    this.stops.add(stopsItem);
    return this;
  }

  /**
   *  <br><br> Breaking Change with PI 15: New mandatory association is required to support upcoming features. 
   * @return stops
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_STOPS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public List getStops() {
    return stops;
  }


  @JsonProperty(JSON_PROPERTY_STOPS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setStops(List stops) {
    this.stops = stops;
  }


  public POI bookingCodes(List bookingCodes) {
    this.bookingCodes = bookingCodes;
    return this;
  }

  public POI addBookingCodesItem(String bookingCodesItem) {
    if (this.bookingCodes == null) {
      this.bookingCodes = new ArrayList<>();
    }
    this.bookingCodes.add(bookingCodesItem);
    return this;
  }

  /**
   * Get bookingCodes
   * @return bookingCodes
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_BOOKING_CODES)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public List getBookingCodes() {
    return bookingCodes;
  }


  @JsonProperty(JSON_PROPERTY_BOOKING_CODES)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setBookingCodes(List bookingCodes) {
    this.bookingCodes = bookingCodes;
  }


  /**
   * Return true if this POI object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    POI POI = (POI) o;
    return Objects.equals(this.description, POI.description) &&
        Objects.equals(this.theLinkID, POI.theLinkID) &&
        equalsNullable(this.evenMoreLinkIDs, POI.evenMoreLinkIDs) &&
        Objects.equals(this.stops, POI.stops) &&
        Objects.equals(this.bookingCodes, POI.bookingCodes) &&
        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(description, theLinkID, hashCodeNullable(evenMoreLinkIDs), stops, bookingCodes, 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 POI {\n");
    sb.append("    ").append(toIndentedString(super.toString())).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    theLinkID: ").append(toIndentedString(theLinkID)).append("\n");
    sb.append("    evenMoreLinkIDs: ").append(toIndentedString(evenMoreLinkIDs)).append("\n");
    sb.append("    stops: ").append(toIndentedString(stops)).append("\n");
    sb.append("    bookingCodes: ").append(toIndentedString(bookingCodes)).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("POI", POI.class);
    JSON.registerDiscriminator(POI.class, "objectType", mappings);
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy