Skip to content

Instantly share code, notes, and snippets.

Created June 9, 2020 16:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
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; = 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 {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment