com.markwolgin.amtrak.data.models.Calendar Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of data Show documentation
Show all versions of data Show documentation
Provides an interface to Amtrak's Station and Train data.
The 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 java.util.Arrays;
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;
/**
* Calendar
*/
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-03-06T18:06:07.465155808-05:00[America/New_York]")
public class Calendar implements Serializable, AmtrakObject {
private static final long serialVersionUID = 1L;
private String serviceId;
private Integer monday;
private Integer tuesday;
private Integer wednesday;
private Integer thursday;
private Integer friday;
private Integer saturday;
private Integer sunday;
private String startDate;
private String endDate;
public Calendar() {
super();
}
/**
* Constructor with only required parameters
*/
public Calendar(String serviceId, Integer monday, Integer tuesday, Integer wednesday, Integer thursday, Integer friday, Integer saturday, Integer sunday, String startDate, String endDate) {
this.serviceId = serviceId;
this.monday = monday;
this.tuesday = tuesday;
this.wednesday = wednesday;
this.thursday = thursday;
this.friday = friday;
this.saturday = saturday;
this.sunday = sunday;
this.startDate = startDate;
this.endDate = endDate;
}
public Calendar serviceId(String serviceId) {
this.serviceId = serviceId;
return this;
}
/**
* A definition for when a service is running. Each Service has a service_id that will link to a calendar, letting the user know when that services will run.
* @return serviceId
*/
@NotNull
@Schema(name = "service_id", description = "A definition for when a service is running. Each Service has a service_id that will link to a calendar, letting the user know when that services will run.", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("service_id")
public String getServiceId() {
return serviceId;
}
public void setServiceId(String serviceId) {
this.serviceId = serviceId;
}
public Calendar monday(Integer monday) {
this.monday = monday;
return this;
}
/**
* If the services operates on Monday.
* @return monday
*/
@NotNull
@Schema(name = "monday", description = "If the services operates on Monday.", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("monday")
public Integer getMonday() {
return monday;
}
public void setMonday(Integer monday) {
this.monday = monday;
}
public Calendar tuesday(Integer tuesday) {
this.tuesday = tuesday;
return this;
}
/**
* If the services operates on Tuesday.
* @return tuesday
*/
@NotNull
@Schema(name = "tuesday", description = "If the services operates on Tuesday.", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("tuesday")
public Integer getTuesday() {
return tuesday;
}
public void setTuesday(Integer tuesday) {
this.tuesday = tuesday;
}
public Calendar wednesday(Integer wednesday) {
this.wednesday = wednesday;
return this;
}
/**
* If the services operates on Wednesday.
* @return wednesday
*/
@NotNull
@Schema(name = "wednesday", description = "If the services operates on Wednesday.", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("wednesday")
public Integer getWednesday() {
return wednesday;
}
public void setWednesday(Integer wednesday) {
this.wednesday = wednesday;
}
public Calendar thursday(Integer thursday) {
this.thursday = thursday;
return this;
}
/**
* If the services operates on Thursday.
* @return thursday
*/
@NotNull
@Schema(name = "thursday", description = "If the services operates on Thursday.", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("thursday")
public Integer getThursday() {
return thursday;
}
public void setThursday(Integer thursday) {
this.thursday = thursday;
}
public Calendar friday(Integer friday) {
this.friday = friday;
return this;
}
/**
* If the services operates on Friday.
* @return friday
*/
@NotNull
@Schema(name = "friday", description = "If the services operates on Friday.", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("friday")
public Integer getFriday() {
return friday;
}
public void setFriday(Integer friday) {
this.friday = friday;
}
public Calendar saturday(Integer saturday) {
this.saturday = saturday;
return this;
}
/**
* If the services operates on Saturday.
* @return saturday
*/
@NotNull
@Schema(name = "saturday", description = "If the services operates on Saturday.", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("saturday")
public Integer getSaturday() {
return saturday;
}
public void setSaturday(Integer saturday) {
this.saturday = saturday;
}
public Calendar sunday(Integer sunday) {
this.sunday = sunday;
return this;
}
/**
* If the services operates on Sunday.
* @return sunday
*/
@NotNull
@Schema(name = "sunday", description = "If the services operates on Sunday.", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("sunday")
public Integer getSunday() {
return sunday;
}
public void setSunday(Integer sunday) {
this.sunday = sunday;
}
public Calendar startDate(String startDate) {
this.startDate = startDate;
return this;
}
/**
* A custom date format that follows YYYYMMDD as a string.
* @return startDate
*/
@NotNull
@Schema(name = "start_date", description = "A custom date format that follows YYYYMMDD as a string.", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("start_date")
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public Calendar endDate(String endDate) {
this.endDate = endDate;
return this;
}
/**
* A custom date format that follows YYYYMMDD as a string.
* @return endDate
*/
@NotNull
@Schema(name = "end_date", description = "A custom date format that follows YYYYMMDD as a string.", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("end_date")
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Calendar calendar = (Calendar) o;
return Objects.equals(this.serviceId, calendar.serviceId) &&
Objects.equals(this.monday, calendar.monday) &&
Objects.equals(this.tuesday, calendar.tuesday) &&
Objects.equals(this.wednesday, calendar.wednesday) &&
Objects.equals(this.thursday, calendar.thursday) &&
Objects.equals(this.friday, calendar.friday) &&
Objects.equals(this.saturday, calendar.saturday) &&
Objects.equals(this.sunday, calendar.sunday) &&
Objects.equals(this.startDate, calendar.startDate) &&
Objects.equals(this.endDate, calendar.endDate);
}
@Override
public int hashCode() {
return Objects.hash(serviceId, monday, tuesday, wednesday, thursday, friday, saturday, sunday, startDate, endDate);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Calendar {\n");
sb.append(" serviceId: ").append(toIndentedString(serviceId)).append("\n");
sb.append(" monday: ").append(toIndentedString(monday)).append("\n");
sb.append(" tuesday: ").append(toIndentedString(tuesday)).append("\n");
sb.append(" wednesday: ").append(toIndentedString(wednesday)).append("\n");
sb.append(" thursday: ").append(toIndentedString(thursday)).append("\n");
sb.append(" friday: ").append(toIndentedString(friday)).append("\n");
sb.append(" saturday: ").append(toIndentedString(saturday)).append("\n");
sb.append(" sunday: ").append(toIndentedString(sunday)).append("\n");
sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n");
sb.append(" endDate: ").append(toIndentedString(endDate)).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 ");
}
}