openapitools.model.Leg 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.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
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.PlaceRef;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import openapitools.JSON;
/**
* Leg
*/
@JsonPropertyOrder({
Leg.JSON_PROPERTY_START,
Leg.JSON_PROPERTY_STOP,
Leg.JSON_PROPERTY_STOPOVERS
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.8.0")
public class Leg {
public static final String JSON_PROPERTY_START = "start";
private PlaceRef start;
public static final String JSON_PROPERTY_STOP = "stop";
private PlaceRef stop;
public static final String JSON_PROPERTY_STOPOVERS = "stopovers";
private List stopovers = new ArrayList<>();
public Leg() {
}
public Leg start(PlaceRef start) {
this.start = start;
return this;
}
/**
* Get start
* @return start
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_START)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public PlaceRef getStart() {
return start;
}
@JsonProperty(JSON_PROPERTY_START)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setStart(PlaceRef start) {
this.start = start;
}
public Leg stop(PlaceRef stop) {
this.stop = stop;
return this;
}
/**
* Get stop
* @return stop
*/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_STOP)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public PlaceRef getStop() {
return stop;
}
@JsonProperty(JSON_PROPERTY_STOP)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setStop(PlaceRef stop) {
this.stop = stop;
}
public Leg stopovers(List stopovers) {
this.stopovers = stopovers;
return this;
}
public Leg addStopoversItem(PlaceRef stopoversItem) {
if (this.stopovers == null) {
this.stopovers = new ArrayList<>();
}
this.stopovers.add(stopoversItem);
return this;
}
/**
* Get stopovers
* @return stopovers
*/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_STOPOVERS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List getStopovers() {
return stopovers;
}
@JsonProperty(JSON_PROPERTY_STOPOVERS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setStopovers(List stopovers) {
this.stopovers = stopovers;
}
/**
* Return true if this Leg object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Leg leg = (Leg) o;
return Objects.equals(this.start, leg.start) &&
Objects.equals(this.stop, leg.stop) &&
Objects.equals(this.stopovers, leg.stopovers);
}
@Override
public int hashCode() {
return Objects.hash(start, stop, stopovers);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Leg {\n");
sb.append(" start: ").append(toIndentedString(start)).append("\n");
sb.append(" stop: ").append(toIndentedString(stop)).append("\n");
sb.append(" stopovers: ").append(toIndentedString(stopovers)).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 ");
}
}