aboutsummaryrefslogtreecommitdiffstats
path: root/hosted-zone-api
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2021-09-13 11:03:19 +0200
committergjoranv <gv@verizonmedia.com>2021-09-13 11:03:19 +0200
commit8b99797f928b2f343cf3466d8fcb379ed422cbd3 (patch)
treea82cebb7a2518e69c9bcd91ef0a5bb9793f6b8d7 /hosted-zone-api
parent3ece097332ee98441099cab6eeb0a7ea63cabc0e (diff)
Improve user-friendliness by requiring non-null for all fields.
Diffstat (limited to 'hosted-zone-api')
-rw-r--r--hosted-zone-api/src/main/java/ai/vespa/cloud/SystemInfo.java5
-rw-r--r--hosted-zone-api/src/main/java/ai/vespa/cloud/Zone.java2
2 files changed, 7 insertions, 0 deletions
diff --git a/hosted-zone-api/src/main/java/ai/vespa/cloud/SystemInfo.java b/hosted-zone-api/src/main/java/ai/vespa/cloud/SystemInfo.java
index 706959438eb..c9500df4d7f 100644
--- a/hosted-zone-api/src/main/java/ai/vespa/cloud/SystemInfo.java
+++ b/hosted-zone-api/src/main/java/ai/vespa/cloud/SystemInfo.java
@@ -1,6 +1,8 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.cloud;
+import java.util.Objects;
+
/**
* Provides information about the system in which this container is running.
* This is available and can be injected when running in a cloud environment.
@@ -14,6 +16,9 @@ public class SystemInfo {
private final Node node;
public SystemInfo(Zone zone, Cluster cluster, Node node) {
+ Objects.requireNonNull(zone, "Zone cannot be null!");
+ Objects.requireNonNull(cluster, "Cluster cannot be null!");
+ Objects.requireNonNull(node, "Node cannot be null!");
this.zone = zone;
this.cluster = cluster;
this.node = node;
diff --git a/hosted-zone-api/src/main/java/ai/vespa/cloud/Zone.java b/hosted-zone-api/src/main/java/ai/vespa/cloud/Zone.java
index 48293aa7908..a6b69d12608 100644
--- a/hosted-zone-api/src/main/java/ai/vespa/cloud/Zone.java
+++ b/hosted-zone-api/src/main/java/ai/vespa/cloud/Zone.java
@@ -16,6 +16,8 @@ public class Zone {
private final String region;
public Zone(Environment environment, String region) {
+ Objects.requireNonNull(environment, "Environment cannot be null!");
+ Objects.requireNonNull(region, "Region cannot be null!");
this.environment = environment;
this.region = region;
}