Package com.adyen.model.checkout
Class Leg
- java.lang.Object
-
- com.adyen.model.checkout.Leg
-
public class Leg extends Object
Leg
-
-
Field Summary
Fields Modifier and Type Field Description static StringJSON_PROPERTY_CARRIER_CODEstatic StringJSON_PROPERTY_CLASS_OF_TRAVELstatic StringJSON_PROPERTY_DATE_OF_TRAVELstatic StringJSON_PROPERTY_DEPARTURE_AIRPORT_CODEstatic StringJSON_PROPERTY_DEPARTURE_TAXstatic StringJSON_PROPERTY_DESTINATION_AIRPORT_CODEstatic StringJSON_PROPERTY_FARE_BASIS_CODEstatic StringJSON_PROPERTY_FLIGHT_NUMBERstatic StringJSON_PROPERTY_STOP_OVER_CODE
-
Constructor Summary
Constructors Constructor Description Leg()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LegcarrierCode(String carrierCode)The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier.LegclassOfTravel(String classOfTravel)A one-letter travel class identifier.LegdateOfTravel(OffsetDateTime dateOfTravel)Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 charactersLegdepartureAirportCode(String departureAirportCode)The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport.LegdepartureTax(Long departureTax)The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros.LegdestinationAirportCode(String destinationAirportCode)The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport.booleanequals(Object o)Return true if this Leg object is equal to o.LegfareBasisCode(String fareBasisCode)The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros.LegflightNumber(String flightNumber)The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros.static LegfromJson(String jsonString)Create an instance of Leg given an JSON stringStringgetCarrierCode()The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier.StringgetClassOfTravel()A one-letter travel class identifier.OffsetDateTimegetDateOfTravel()Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 charactersStringgetDepartureAirportCode()The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport.LonggetDepartureTax()The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros.StringgetDestinationAirportCode()The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport.StringgetFareBasisCode()The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros.StringgetFlightNumber()The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros.StringgetStopOverCode()A one-letter code that indicates whether the passenger is entitled to make a stopover.inthashCode()voidsetCarrierCode(String carrierCode)The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier.voidsetClassOfTravel(String classOfTravel)A one-letter travel class identifier.voidsetDateOfTravel(OffsetDateTime dateOfTravel)Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 charactersvoidsetDepartureAirportCode(String departureAirportCode)The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport.voidsetDepartureTax(Long departureTax)The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros.voidsetDestinationAirportCode(String destinationAirportCode)The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport.voidsetFareBasisCode(String fareBasisCode)The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros.voidsetFlightNumber(String flightNumber)The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros.voidsetStopOverCode(String stopOverCode)A one-letter code that indicates whether the passenger is entitled to make a stopover.LegstopOverCode(String stopOverCode)A one-letter code that indicates whether the passenger is entitled to make a stopover.StringtoJson()Convert an instance of Leg to an JSON stringStringtoString()
-
-
-
Field Detail
-
JSON_PROPERTY_CARRIER_CODE
public static final String JSON_PROPERTY_CARRIER_CODE
- See Also:
- Constant Field Values
-
JSON_PROPERTY_CLASS_OF_TRAVEL
public static final String JSON_PROPERTY_CLASS_OF_TRAVEL
- See Also:
- Constant Field Values
-
JSON_PROPERTY_DATE_OF_TRAVEL
public static final String JSON_PROPERTY_DATE_OF_TRAVEL
- See Also:
- Constant Field Values
-
JSON_PROPERTY_DEPARTURE_AIRPORT_CODE
public static final String JSON_PROPERTY_DEPARTURE_AIRPORT_CODE
- See Also:
- Constant Field Values
-
JSON_PROPERTY_DEPARTURE_TAX
public static final String JSON_PROPERTY_DEPARTURE_TAX
- See Also:
- Constant Field Values
-
JSON_PROPERTY_DESTINATION_AIRPORT_CODE
public static final String JSON_PROPERTY_DESTINATION_AIRPORT_CODE
- See Also:
- Constant Field Values
-
JSON_PROPERTY_FARE_BASIS_CODE
public static final String JSON_PROPERTY_FARE_BASIS_CODE
- See Also:
- Constant Field Values
-
JSON_PROPERTY_FLIGHT_NUMBER
public static final String JSON_PROPERTY_FLIGHT_NUMBER
- See Also:
- Constant Field Values
-
JSON_PROPERTY_STOP_OVER_CODE
public static final String JSON_PROPERTY_STOP_OVER_CODE
- See Also:
- Constant Field Values
-
-
Method Detail
-
carrierCode
public Leg carrierCode(String carrierCode)
The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Parameters:
carrierCode- The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Returns:
- the current
Leginstance, allowing for method chaining
-
getCarrierCode
public String getCarrierCode()
The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Returns:
- carrierCode The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. * Must not be all zeros.
-
setCarrierCode
public void setCarrierCode(String carrierCode)
The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Parameters:
carrierCode- The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not start with a space or be all spaces. * Must not be all zeros.
-
classOfTravel
public Leg classOfTravel(String classOfTravel)
A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not start with a space or be all spaces. * Must not be all zeros.- Parameters:
classOfTravel- A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not start with a space or be all spaces. * Must not be all zeros.- Returns:
- the current
Leginstance, allowing for method chaining
-
getClassOfTravel
public String getClassOfTravel()
A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not start with a space or be all spaces. * Must not be all zeros.- Returns:
- classOfTravel A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not start with a space or be all spaces. * Must not be all zeros.
-
setClassOfTravel
public void setClassOfTravel(String classOfTravel)
A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not start with a space or be all spaces. * Must not be all zeros.- Parameters:
classOfTravel- A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not start with a space or be all spaces. * Must not be all zeros.
-
dateOfTravel
public Leg dateOfTravel(OffsetDateTime dateOfTravel)
Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 characters- Parameters:
dateOfTravel- Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 characters- Returns:
- the current
Leginstance, allowing for method chaining
-
getDateOfTravel
public OffsetDateTime getDateOfTravel()
Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 characters- Returns:
- dateOfTravel Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 characters
-
setDateOfTravel
public void setDateOfTravel(OffsetDateTime dateOfTravel)
Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 characters- Parameters:
dateOfTravel- Date and time of travel in format `yyyy-MM-ddTHH:mm`. * Use local time of departure airport. * minLength: 16 characters * maxLength: 16 characters
-
departureAirportCode
public Leg departureAirportCode(String departureAirportCode)
The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Parameters:
departureAirportCode- The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Returns:
- the current
Leginstance, allowing for method chaining
-
getDepartureAirportCode
public String getDepartureAirportCode()
The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Returns:
- departureAirportCode The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.
-
setDepartureAirportCode
public void setDepartureAirportCode(String departureAirportCode)
The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Parameters:
departureAirportCode- The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.
-
departureTax
public Leg departureTax(Long departureTax)
The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros.- Parameters:
departureTax- The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros.- Returns:
- the current
Leginstance, allowing for method chaining
-
getDepartureTax
public Long getDepartureTax()
The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros.- Returns:
- departureTax The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros.
-
setDepartureTax
public void setDepartureTax(Long departureTax)
The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros.- Parameters:
departureTax- The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 11 * Must not be all zeros.
-
destinationAirportCode
public Leg destinationAirportCode(String destinationAirportCode)
The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Parameters:
destinationAirportCode- The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Returns:
- the current
Leginstance, allowing for method chaining
-
getDestinationAirportCode
public String getDestinationAirportCode()
The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Returns:
- destinationAirportCode The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.
-
setDestinationAirportCode
public void setDestinationAirportCode(String destinationAirportCode)
The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Parameters:
destinationAirportCode- The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not start with a space or be all spaces. * Must not be all zeros.
-
fareBasisCode
public Leg fareBasisCode(String fareBasisCode)
The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Parameters:
fareBasisCode- The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Returns:
- the current
Leginstance, allowing for method chaining
-
getFareBasisCode
public String getFareBasisCode()
The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Returns:
- fareBasisCode The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros.
-
setFareBasisCode
public void setFareBasisCode(String fareBasisCode)
The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Parameters:
fareBasisCode- The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not start with a space or be all spaces. * Must not be all zeros.
-
flightNumber
public Leg flightNumber(String flightNumber)
The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Parameters:
flightNumber- The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Returns:
- the current
Leginstance, allowing for method chaining
-
getFlightNumber
public String getFlightNumber()
The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Returns:
- flightNumber The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros.
-
setFlightNumber
public void setFlightNumber(String flightNumber)
The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros.- Parameters:
flightNumber- The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not start with a space or be all spaces. * Must not be all zeros.
-
stopOverCode
public Leg stopOverCode(String stopOverCode)
A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character- Parameters:
stopOverCode- A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character- Returns:
- the current
Leginstance, allowing for method chaining
-
getStopOverCode
public String getStopOverCode()
A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character- Returns:
- stopOverCode A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character
-
setStopOverCode
public void setStopOverCode(String stopOverCode)
A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character- Parameters:
stopOverCode- A one-letter code that indicates whether the passenger is entitled to make a stopover. Can be a space, O if the passenger is entitled to make a stopover, or X if they are not. * Encoding: ASCII * minLength: 1 character * maxLength: 1 character
-
equals
public boolean equals(Object o)
Return true if this Leg object is equal to o.
-
fromJson
public static Leg fromJson(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException
Create an instance of Leg given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of Leg
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if the JSON string is invalid with respect to Leg
-
toJson
public String toJson() throws com.fasterxml.jackson.core.JsonProcessingException
Convert an instance of Leg to an JSON string- Returns:
- JSON string
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
-