diff options
Diffstat (limited to 'controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfoBillingContact.java')
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfoBillingContact.java | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfoBillingContact.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfoBillingContact.java deleted file mode 100644 index c875a19d57b..00000000000 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfoBillingContact.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.hosted.controller.tenant; - -import java.util.Objects; - -/** - * @author smorgrav - */ -public class TenantInfoBillingContact { - - // All fields are editable in 'Billing - Edit billing contact' - // Only 'name' and 'email' are exposed outside the 'Edit billing contact' form. - // All these fields are required by the billing process. - private final String name; - private final String email; - private final String phone; - private final TenantInfoAddress address; - - TenantInfoBillingContact(String name, String email, String phone, TenantInfoAddress address) { - this.name = Objects.requireNonNull(name); - this.email = Objects.requireNonNull(email); - this.phone = Objects.requireNonNull(phone); - this.address = Objects.requireNonNull(address); - } - - public static final TenantInfoBillingContact EMPTY = - new TenantInfoBillingContact("","", "", TenantInfoAddress.EMPTY); - - public String name() { - return name; - } - - public String email() { return email; } - - public String phone() { - return phone; - } - - public TenantInfoAddress address() { - return address; - } - - public TenantInfoBillingContact withName(String newName) { - return new TenantInfoBillingContact(newName, email, phone, address); - } - - public TenantInfoBillingContact withEmail(String newEmail) { - return new TenantInfoBillingContact(name, newEmail, phone, address); - } - - public TenantInfoBillingContact withPhone(String newPhone) { - return new TenantInfoBillingContact(name, email, newPhone, address); - } - - public TenantInfoBillingContact withAddress(TenantInfoAddress newAddress) { - return new TenantInfoBillingContact(name, email, phone, newAddress); - } - - public boolean isEmpty() { - return this.equals(EMPTY); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - TenantInfoBillingContact that = (TenantInfoBillingContact) o; - return name.equals(that.name) && - email.equals(that.email) && - phone.equals(that.phone) && - address.equals(that.address); - } - - @Override - public int hashCode() { - return Objects.hash(name, email, phone, address); - } -} |