Skip to content

Commit b0ab0f2

Browse files
committed
enums for Contact.DeviceType and Document.DocumentType
1 parent 9880562 commit b0ab0f2

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

src/main/java/com/amadeus/resources/FlightOrder.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
/**
1010
* An Airline object as returned by the Airline Code LookUp API.
11-
* @see com.amadeus.booking.flightOrder#get()
11+
* @see com.amadeus.booking.FlightOrder#get()
1212
*/
1313
@ToString
1414
public class FlightOrder extends Resource {
@@ -59,20 +59,34 @@ public static class Name {
5959
public static class Contact {
6060

6161
private @Getter @Setter Phone[] phones;
62-
private @Getter @Setter String deviceType;
62+
private @Getter @Setter DeviceType deviceType;
63+
64+
public enum DeviceType {
65+
MOBILE,
66+
LANDLINE,
67+
FAX
68+
}
6369
}
6470

6571
@AllArgsConstructor
6672
@NoArgsConstructor
6773
@ToString
6874
public static class Document {
6975

70-
private @Getter @Setter String documentType;
76+
private @Getter @Setter DocumentType documentType;
7177
private @Getter @Setter String number;
7278
public @Getter @Setter String expiryDate;
7379
private @Getter @Setter String issuanceCountry;
7480
private @Getter @Setter String nationality;
7581
private @Getter @Setter boolean holder;
82+
83+
public enum DocumentType {
84+
VISA,
85+
PASSPORT,
86+
IDENTITY_CARD,
87+
KNOWN_TRAVELER,
88+
REDRESS
89+
}
7690
}
7791

7892
@AllArgsConstructor

src/test/java/com/amadeus/booking/FlightOrdersIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,12 @@ private Traveler[] getTravelerData() {
116116

117117
Contact contact = new Contact();
118118
contact.setPhones(phone);
119+
contact.setDeviceType(Contact.DeviceType.MOBILE);
119120
traveler.setContact(contact);
120121

121122
Document[] document = new Document[1];
122123
document[0] = new Document();
123-
document[0].setDocumentType("PASSPORT");
124+
document[0].setDocumentType(Document.DocumentType.PASSPORT);
124125
document[0].setNumber("480080076");
125126
document[0].setExpiryDate("2022-10-11");
126127
document[0].setIssuanceCountry("ES");

0 commit comments

Comments
 (0)