aboutsummaryrefslogtreecommitdiffstats
path: root/controller-api/src/main/java
diff options
context:
space:
mode:
authorØyvind Grønnesby <oyving@verizonmedia.com>2022-03-01 11:28:13 +0100
committerLeandro Alves <leandroalves@yahooinc.com>2022-03-14 11:01:55 +0100
commit44fb5236f8949820632bffa12feaddee75ce31d2 (patch)
tree4963855d47815bd739fd458966bc33f97803d436 /controller-api/src/main/java
parent6012cf065da30cf9baee97706d67a6ff6e77cb46 (diff)
Rename TenantInfoBillingContact -> TenantBilling
Diffstat (limited to 'controller-api/src/main/java')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantBilling.java (renamed from controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfoBillingContact.java)20
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfo.java12
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfoContacts.java28
3 files changed, 44 insertions, 16 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/TenantBilling.java
index 2c9a0196905..53ded1983cb 100644
--- 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/TenantBilling.java
@@ -6,22 +6,22 @@ import java.util.Objects;
/**
* @author smorgrav
*/
-public class TenantInfoBillingContact {
+public class TenantBilling {
private final TenantContact contact;
private final TenantAddress address;
- TenantInfoBillingContact(String name, String email, String phone, TenantAddress address) {
+ TenantBilling(String name, String email, String phone, TenantAddress address) {
this(TenantContact.from(name, email, phone), address);
}
- TenantInfoBillingContact(TenantContact contact, TenantAddress address) {
+ TenantBilling(TenantContact contact, TenantAddress address) {
this.contact = Objects.requireNonNull(contact);
this.address = Objects.requireNonNull(address);
}
- public static TenantInfoBillingContact empty() {
- return new TenantInfoBillingContact("", "", "", TenantAddress.empty());
+ public static TenantBilling empty() {
+ return new TenantBilling("", "", "", TenantAddress.empty());
}
public TenantContact contact() {
@@ -32,12 +32,12 @@ public class TenantInfoBillingContact {
return address;
}
- public TenantInfoBillingContact withContact(TenantContact updatedContact) {
- return new TenantInfoBillingContact(updatedContact, this.address);
+ public TenantBilling withContact(TenantContact updatedContact) {
+ return new TenantBilling(updatedContact, this.address);
}
- public TenantInfoBillingContact withAddress(TenantAddress updatedAddress) {
- return new TenantInfoBillingContact(this.contact, updatedAddress);
+ public TenantBilling withAddress(TenantAddress updatedAddress) {
+ return new TenantBilling(this.contact, updatedAddress);
}
public boolean isEmpty() {
@@ -48,7 +48,7 @@ public class TenantInfoBillingContact {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
- TenantInfoBillingContact that = (TenantInfoBillingContact) o;
+ TenantBilling that = (TenantBilling) o;
return Objects.equals(contact, that.contact) && Objects.equals(address, that.address);
}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfo.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfo.java
index 9a295c5d19a..f658ec4ece9 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfo.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfo.java
@@ -20,14 +20,14 @@ public class TenantInfo {
private final TenantContact contact;
private final TenantAddress address;
- private final TenantInfoBillingContact billingContact;
+ private final TenantBilling billingContact;
TenantInfo(String name, String email, String website, String contactName, String contactEmail,
- TenantAddress address, TenantInfoBillingContact billingContact) {
+ TenantAddress address, TenantBilling billingContact) {
this(name, email, website, TenantContact.from(contactName, contactEmail), address, billingContact);
}
- TenantInfo(String name, String email, String website, TenantContact contact, TenantAddress address, TenantInfoBillingContact billing) {
+ TenantInfo(String name, String email, String website, TenantContact contact, TenantAddress address, TenantBilling billing) {
this.name = Objects.requireNonNull(name);
this.email = Objects.requireNonNull(email);
this.website = Objects.requireNonNull(website);
@@ -37,7 +37,7 @@ public class TenantInfo {
}
public static TenantInfo empty() {
- return new TenantInfo("", "", "", "", "", TenantAddress.empty(), TenantInfoBillingContact.empty());
+ return new TenantInfo("", "", "", "", "", TenantAddress.empty(), TenantBilling.empty());
}
public String name() {
@@ -56,7 +56,7 @@ public class TenantInfo {
public TenantAddress address() { return address; }
- public TenantInfoBillingContact billingContact() {
+ public TenantBilling billingContact() {
return billingContact;
}
@@ -84,7 +84,7 @@ public class TenantInfo {
return new TenantInfo(name, email, website, contact, address, billingContact);
}
- public TenantInfo withBilling(TenantInfoBillingContact billingContact) {
+ public TenantInfo withBilling(TenantBilling billingContact) {
return new TenantInfo(name, email, website, contact, address, billingContact);
}
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfoContacts.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfoContacts.java
new file mode 100644
index 00000000000..dddbcdd1d91
--- /dev/null
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/tenant/TenantInfoContacts.java
@@ -0,0 +1,28 @@
+// 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.EnumMap;
+
+/**
+ * @author ogronnesby
+ */
+public class TenantInfoContacts {
+ private final EnumMap<ContactType, TenantContact> contacts;
+
+ TenantInfoContacts() {
+ this.contacts = new EnumMap<>(ContactType.class);
+ }
+
+ public enum ContactType {
+ DEFAULT("default"),
+ PRODUCT("product");
+
+ private final String value;
+
+ ContactType(String value) {
+ this.value = value;
+ }
+
+ public String value() { return value; }
+ }
+}