Skip to content

Commit 99013ab

Browse files
enums for Contact.DeviceType and Document.DocumentType (#201)
* enums for Contact.DeviceType and Document.DocumentType
1 parent 01db25f commit 99013ab

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
import lombok.Setter;
77
import lombok.ToString;
88

9+
910
/**
1011
* An Airline object as returned by the Airline Code LookUp API.
11-
* @see com.amadeus.booking.flightOrder#get()
12+
* @see com.amadeus.booking.FlightOrder#get()
1213
*/
1314
@ToString
1415
public class FlightOrder extends Resource {
@@ -59,20 +60,34 @@ public static class Name {
5960
public static class Contact {
6061

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

6572
@AllArgsConstructor
6673
@NoArgsConstructor
6774
@ToString
6875
public static class Document {
6976

70-
private @Getter @Setter String documentType;
77+
private @Getter @Setter DocumentType documentType;
7178
private @Getter @Setter String number;
7279
public @Getter @Setter String expiryDate;
7380
private @Getter @Setter String issuanceCountry;
7481
private @Getter @Setter String nationality;
7582
private @Getter @Setter boolean holder;
83+
84+
public enum DocumentType {
85+
VISA,
86+
PASSPORT,
87+
IDENTITY_CARD,
88+
KNOWN_TRAVELER,
89+
REDRESS
90+
}
7691
}
7792

7893
@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)