io.sphere.sdk.customers.CustomerName Maven / Gradle / Ivy
package io.sphere.sdk.customers;
import io.sphere.sdk.models.Base;
import java.util.Optional;
public class CustomerName extends Base {
private final Optional title;
private final String firstName;
private final Optional middleName;
private final String lastName;
private CustomerName(final Optional title, final String firstName, final Optional middleName, final String lastName) {
this.title = title;
this.firstName = firstName;
this.middleName = middleName;
this.lastName = lastName;
}
public Optional getTitle() {
return title;
}
public String getFirstName() {
return firstName;
}
public Optional getMiddleName() {
return middleName;
}
public String getLastName() {
return lastName;
}
public static CustomerName ofFirstAndLastName(final String firstName, final String lastName) {
return new CustomerName(Optional.empty(), firstName, Optional.empty(), lastName);
}
public static CustomerName ofTitleFirstAndLastName(final String title, final String firstName, final String lastName) {
return new CustomerName(Optional.of(title), firstName, Optional.empty(), lastName);
}
public static CustomerName of(final Optional title, final String firstName, final Optional middleName, final String lastName) {
return new CustomerName(title, firstName, middleName, lastName);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy