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

com.markwolgin.amtrak.data.models.ConsolidatedRoute Maven / Gradle / Ivy

There is a newer version: 0.1.24
Show newest version
package com.markwolgin.amtrak.data.models;

import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.markwolgin.amtrak.data.models.ConsolidatedTrip;
import com.markwolgin.amtrak.data.models.Stops;
import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import org.openapitools.jackson.nullable.JsonNullable;
import java.io.Serializable;
import java.time.OffsetDateTime;
import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;


import java.util.*;
import jakarta.annotation.Generated;

/**
 * A specific Amtrak Route, such as the Keystone, and all of its associated trips, stops, and other relevant metadata.
 */

@Schema(name = "ConsolidatedRoute", description = "A specific Amtrak Route, such as the Keystone, and all of its associated trips, stops, and other relevant metadata.")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-03-17T14:37:19.770346481Z[GMT]")
public class ConsolidatedRoute implements Serializable, ConsolidatedObjects {

  private static final long serialVersionUID = 1L;

  private String routeId;

  private String routeShortName;

  private String routeLongName;

  private Integer routeType;

  private URI routeUrl;

  private String routeColor;

  private String routeTextColor;

  @Valid
  private JsonNullable> tripList = JsonNullable.>undefined();

  @Valid
  private JsonNullable> allStops = JsonNullable.>undefined();

  @Valid
  private List stopOrder = new ArrayList<>();

  public ConsolidatedRoute() {
    super();
  }

  /**
   * Constructor with only required parameters
   */
  public ConsolidatedRoute(String routeId, String routeShortName, String routeLongName, Integer routeType, URI routeUrl, String routeColor, String routeTextColor, Map tripList, Map allStops, List stopOrder) {
    this.routeId = routeId;
    this.routeShortName = routeShortName;
    this.routeLongName = routeLongName;
    this.routeType = routeType;
    this.routeUrl = routeUrl;
    this.routeColor = routeColor;
    this.routeTextColor = routeTextColor;
    this.tripList = JsonNullable.of(tripList);
    this.allStops = JsonNullable.of(allStops);
    this.stopOrder = stopOrder;
  }

  public ConsolidatedRoute routeId(String routeId) {
    this.routeId = routeId;
    return this;
  }

  /**
   * Specific Route Identifier.
   * @return routeId
  */
  @NotNull 
  @Schema(name = "route_id", description = "Specific Route Identifier.", requiredMode = Schema.RequiredMode.REQUIRED)
  @JsonProperty("route_id")
  public String getRouteId() {
    return routeId;
  }

  public void setRouteId(String routeId) {
    this.routeId = routeId;
  }

  public ConsolidatedRoute routeShortName(String routeShortName) {
    this.routeShortName = routeShortName;
    return this;
  }

  /**
   * The short name of the route.
   * @return routeShortName
  */
  @NotNull 
  @Schema(name = "route_short_name", description = "The short name of the route.", requiredMode = Schema.RequiredMode.REQUIRED)
  @JsonProperty("route_short_name")
  public String getRouteShortName() {
    return routeShortName;
  }

  public void setRouteShortName(String routeShortName) {
    this.routeShortName = routeShortName;
  }

  public ConsolidatedRoute routeLongName(String routeLongName) {
    this.routeLongName = routeLongName;
    return this;
  }

  /**
   * The long name of the route.
   * @return routeLongName
  */
  @NotNull 
  @Schema(name = "route_long_name", description = "The long name of the route.", requiredMode = Schema.RequiredMode.REQUIRED)
  @JsonProperty("route_long_name")
  public String getRouteLongName() {
    return routeLongName;
  }

  public void setRouteLongName(String routeLongName) {
    this.routeLongName = routeLongName;
  }

  public ConsolidatedRoute routeType(Integer routeType) {
    this.routeType = routeType;
    return this;
  }

  /**
   * The route type.
   * @return routeType
  */
  @NotNull 
  @Schema(name = "route_type", description = "The route type.", requiredMode = Schema.RequiredMode.REQUIRED)
  @JsonProperty("route_type")
  public Integer getRouteType() {
    return routeType;
  }

  public void setRouteType(Integer routeType) {
    this.routeType = routeType;
  }

  public ConsolidatedRoute routeUrl(URI routeUrl) {
    this.routeUrl = routeUrl;
    return this;
  }

  /**
   * The url for getting information about the route.
   * @return routeUrl
  */
  @NotNull @Valid 
  @Schema(name = "route_url", description = "The url for getting information about the route.", requiredMode = Schema.RequiredMode.REQUIRED)
  @JsonProperty("route_url")
  public URI getRouteUrl() {
    return routeUrl;
  }

  public void setRouteUrl(URI routeUrl) {
    this.routeUrl = routeUrl;
  }

  public ConsolidatedRoute routeColor(String routeColor) {
    this.routeColor = routeColor;
    return this;
  }

  /**
   * A hex representation of the color of the route.
   * @return routeColor
  */
  @NotNull 
  @Schema(name = "route_color", description = "A hex representation of the color of the route.", requiredMode = Schema.RequiredMode.REQUIRED)
  @JsonProperty("route_color")
  public String getRouteColor() {
    return routeColor;
  }

  public void setRouteColor(String routeColor) {
    this.routeColor = routeColor;
  }

  public ConsolidatedRoute routeTextColor(String routeTextColor) {
    this.routeTextColor = routeTextColor;
    return this;
  }

  /**
   * A hex representation of the text color of the route.
   * @return routeTextColor
  */
  @NotNull 
  @Schema(name = "route_text_color", description = "A hex representation of the text color of the route.", requiredMode = Schema.RequiredMode.REQUIRED)
  @JsonProperty("route_text_color")
  public String getRouteTextColor() {
    return routeTextColor;
  }

  public void setRouteTextColor(String routeTextColor) {
    this.routeTextColor = routeTextColor;
  }

  public ConsolidatedRoute tripList(Map tripList) {
    this.tripList = JsonNullable.of(tripList);
    return this;
  }

  /**
   * A (key, ConsolidatedTrip) map.
   * @return tripList
  */
  @NotNull @Valid 
  @Schema(name = "trip_list", description = "A (key, ConsolidatedTrip) map.", requiredMode = Schema.RequiredMode.REQUIRED)
  @JsonProperty("trip_list")
  public JsonNullable> getTripList() {
    return tripList;
  }

  public void setTripList(JsonNullable> tripList) {
    this.tripList = tripList;
  }

  public ConsolidatedRoute allStops(Map allStops) {
    this.allStops = JsonNullable.of(allStops);
    return this;
  }

  /**
   * A (key, Stop) map.
   * @return allStops
  */
  @NotNull @Valid 
  @Schema(name = "all_stops", description = "A (key, Stop) map.", requiredMode = Schema.RequiredMode.REQUIRED)
  @JsonProperty("all_stops")
  public JsonNullable> getAllStops() {
    return allStops;
  }

  public void setAllStops(JsonNullable> allStops) {
    this.allStops = allStops;
  }

  public ConsolidatedRoute stopOrder(List stopOrder) {
    this.stopOrder = stopOrder;
    return this;
  }

  public ConsolidatedRoute addStopOrderItem(Object stopOrderItem) {
    if (this.stopOrder == null) {
      this.stopOrder = new ArrayList<>();
    }
    this.stopOrder.add(stopOrderItem);
    return this;
  }

  /**
   * An ordered list of a routes, ordered descending from direction 0.
   * @return stopOrder
  */
  @NotNull 
  @Schema(name = "stop_order", description = "An ordered list of a routes, ordered descending from direction 0.", requiredMode = Schema.RequiredMode.REQUIRED)
  @JsonProperty("stop_order")
  public List getStopOrder() {
    return stopOrder;
  }

  public void setStopOrder(List stopOrder) {
    this.stopOrder = stopOrder;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ConsolidatedRoute consolidatedRoute = (ConsolidatedRoute) o;
    return Objects.equals(this.routeId, consolidatedRoute.routeId) &&
        Objects.equals(this.routeShortName, consolidatedRoute.routeShortName) &&
        Objects.equals(this.routeLongName, consolidatedRoute.routeLongName) &&
        Objects.equals(this.routeType, consolidatedRoute.routeType) &&
        Objects.equals(this.routeUrl, consolidatedRoute.routeUrl) &&
        Objects.equals(this.routeColor, consolidatedRoute.routeColor) &&
        Objects.equals(this.routeTextColor, consolidatedRoute.routeTextColor) &&
        Objects.equals(this.tripList, consolidatedRoute.tripList) &&
        Objects.equals(this.allStops, consolidatedRoute.allStops) &&
        Objects.equals(this.stopOrder, consolidatedRoute.stopOrder);
  }

  @Override
  public int hashCode() {
    return Objects.hash(routeId, routeShortName, routeLongName, routeType, routeUrl, routeColor, routeTextColor, tripList, allStops, stopOrder);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ConsolidatedRoute {\n");
    sb.append("    routeId: ").append(toIndentedString(routeId)).append("\n");
    sb.append("    routeShortName: ").append(toIndentedString(routeShortName)).append("\n");
    sb.append("    routeLongName: ").append(toIndentedString(routeLongName)).append("\n");
    sb.append("    routeType: ").append(toIndentedString(routeType)).append("\n");
    sb.append("    routeUrl: ").append(toIndentedString(routeUrl)).append("\n");
    sb.append("    routeColor: ").append(toIndentedString(routeColor)).append("\n");
    sb.append("    routeTextColor: ").append(toIndentedString(routeTextColor)).append("\n");
    sb.append("    tripList: ").append(toIndentedString(tripList)).append("\n");
    sb.append("    allStops: ").append(toIndentedString(allStops)).append("\n");
    sb.append("    stopOrder: ").append(toIndentedString(stopOrder)).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    ");
  }
}