Package com.adyen.model.checkout
Class Passenger
- java.lang.Object
-
- com.adyen.model.checkout.Passenger
-
public class Passenger extends Object
Passenger
-
-
Field Summary
Fields Modifier and Type Field Description static StringJSON_PROPERTY_DATE_OF_BIRTHstatic StringJSON_PROPERTY_FIRST_NAMEstatic StringJSON_PROPERTY_LAST_NAMEstatic StringJSON_PROPERTY_PHONE_NUMBERstatic StringJSON_PROPERTY_TRAVELLER_TYPE
-
Constructor Summary
Constructors Constructor Description Passenger()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PassengerdateOfBirth(LocalDate dateOfBirth)The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10booleanequals(Object o)Return true if this Passenger object is equal to o.PassengerfirstName(String firstName)The passenger's first name.static PassengerfromJson(String jsonString)Create an instance of Passenger given an JSON stringLocalDategetDateOfBirth()The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10Map<String,Object>getExplicitNulls()Returns a map of properties to be merged into the JSON payload as explicit null values.StringgetFirstName()The passenger's first name.StringgetLastName()The passenger's last name.StringgetPhoneNumber()The passenger's phone number, including country code.StringgetTravellerType()The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 charactersinthashCode()PassengerincludeNullValues(boolean includeNullValues)Configures whether null values are explicitly serialized in the JSON payload.booleanisIncludeNullValues()Returns whether null values are explicitly serialized in the JSON payload.PassengerlastName(String lastName)The passenger's last name.PassengerphoneNumber(String phoneNumber)The passenger's phone number, including country code.voidsetDateOfBirth(LocalDate dateOfBirth)The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10voidsetFirstName(String firstName)The passenger's first name.voidsetIncludeNullValues(boolean includeNullValues)Sets whether null values should be explicitly serialized in the JSON payload.voidsetLastName(String lastName)The passenger's last name.voidsetPhoneNumber(String phoneNumber)The passenger's phone number, including country code.voidsetTravellerType(String travellerType)The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 charactersStringtoJson()Convert an instance of Passenger to an JSON stringStringtoString()PassengertravellerType(String travellerType)The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters
-
-
-
Field Detail
-
JSON_PROPERTY_DATE_OF_BIRTH
public static final String JSON_PROPERTY_DATE_OF_BIRTH
- See Also:
- Constant Field Values
-
JSON_PROPERTY_FIRST_NAME
public static final String JSON_PROPERTY_FIRST_NAME
- See Also:
- Constant Field Values
-
JSON_PROPERTY_LAST_NAME
public static final String JSON_PROPERTY_LAST_NAME
- See Also:
- Constant Field Values
-
JSON_PROPERTY_PHONE_NUMBER
public static final String JSON_PROPERTY_PHONE_NUMBER
- See Also:
- Constant Field Values
-
JSON_PROPERTY_TRAVELLER_TYPE
public static final String JSON_PROPERTY_TRAVELLER_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
dateOfBirth
public Passenger dateOfBirth(LocalDate dateOfBirth)
The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10- Parameters:
dateOfBirth- The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10- Returns:
- the current
Passengerinstance, allowing for method chaining
-
getDateOfBirth
public LocalDate getDateOfBirth()
The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10- Returns:
- dateOfBirth The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10
-
setDateOfBirth
public void setDateOfBirth(LocalDate dateOfBirth)
The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10- Parameters:
dateOfBirth- The passenger's date of birth. * Format `yyyy-MM-dd` * minLength: 10 * maxLength: 10
-
firstName
public Passenger firstName(String firstName)
The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII- Parameters:
firstName- The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII- Returns:
- the current
Passengerinstance, allowing for method chaining
-
getFirstName
public String getFirstName()
The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII- Returns:
- firstName The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII
-
setFirstName
public void setFirstName(String firstName)
The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII- Parameters:
firstName- The passenger's first name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII
-
lastName
public Passenger lastName(String lastName)
The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII- Parameters:
lastName- The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII- Returns:
- the current
Passengerinstance, allowing for method chaining
-
getLastName
public String getLastName()
The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII- Returns:
- lastName The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII
-
setLastName
public void setLastName(String lastName)
The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII- Parameters:
lastName- The passenger's last name. > This field is required if the airline data includes passenger details or leg details. * Encoding: ASCII
-
phoneNumber
public Passenger phoneNumber(String phoneNumber)
The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters- Parameters:
phoneNumber- The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters- Returns:
- the current
Passengerinstance, allowing for method chaining
-
getPhoneNumber
public String getPhoneNumber()
The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters- Returns:
- phoneNumber The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters
-
setPhoneNumber
public void setPhoneNumber(String phoneNumber)
The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters- Parameters:
phoneNumber- The passenger's phone number, including country code. This is an alphanumeric field that can include the '+' and '-' signs. * Encoding: ASCII * minLength: 3 characters * maxLength: 30 characters
-
travellerType
public Passenger travellerType(String travellerType)
The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters- Parameters:
travellerType- The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters- Returns:
- the current
Passengerinstance, allowing for method chaining
-
getTravellerType
public String getTravellerType()
The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters- Returns:
- travellerType The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters
-
setTravellerType
public void setTravellerType(String travellerType)
The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters- Parameters:
travellerType- The IATA passenger type code (PTC). * Encoding: ASCII * minLength: 3 characters * maxLength: 6 characters
-
includeNullValues
public Passenger includeNullValues(boolean includeNullValues)
Configures whether null values are explicitly serialized in the JSON payload. Default is false.
-
isIncludeNullValues
public boolean isIncludeNullValues()
Returns whether null values are explicitly serialized in the JSON payload.
-
setIncludeNullValues
public void setIncludeNullValues(boolean includeNullValues)
Sets whether null values should be explicitly serialized in the JSON payload. Default is false.
-
equals
public boolean equals(Object o)
Return true if this Passenger object is equal to o.
-
getExplicitNulls
public Map<String,Object> getExplicitNulls()
Returns a map of properties to be merged into the JSON payload as explicit null values.
-
fromJson
public static Passenger fromJson(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException
Create an instance of Passenger given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of Passenger
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if the JSON string is invalid with respect to Passenger
-
toJson
public String toJson() throws com.fasterxml.jackson.core.JsonProcessingException
Convert an instance of Passenger to an JSON string- Returns:
- JSON string
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
-