Created
June 9, 2020 16:44
-
-
Save theboreddev/9051b5b24569cd53af7f6d199628af6e to your computer and use it in GitHub Desktop.
wrongOptionalUse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class Customer { | |
private final String firstName; | |
private final String surname; | |
private final Optional<Integer> age; | |
private final Optional<String> address; | |
private final Optional<String> phoneNumber; | |
private final Optional<Sex> sex; | |
public Customer(String firstName, String surname, Optional<Integer> age, Optional<String> address, Optional<String> phoneNumber, Optional<Sex> sex) { | |
this.firstName = firstName; | |
this.surname = surname; | |
this.age = age; | |
this.address = address; | |
this.phoneNumber = phoneNumber; | |
this.sex = sex; | |
} | |
public String getFirstName() { | |
return firstName; | |
} | |
public String getSurname() { | |
return surname; | |
} | |
public Optional<Integer> getAge() { | |
return age; | |
} | |
public Optional<String> getAddress() { | |
return address; | |
} | |
public Optional<String> getPhoneNumber() { | |
return phoneNumber; | |
} | |
public Optional<Sex> getSex() { | |
return sex; | |
} | |
} | |
static enum Sex { | |
FEMALE, | |
MALE | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment