summaryrefslogtreecommitdiffstats
path: root/orchestrator-restapi
diff options
context:
space:
mode:
authorHarald Musum <musum@yahoo-inc.com>2016-07-05 08:17:12 +0200
committerHarald Musum <musum@yahoo-inc.com>2016-07-05 08:17:12 +0200
commitac0d36d85cec4f961d5b9008c2d7fc2e5e943160 (patch)
tree47278822d0ec5a42308c4315fbac7645d963c033 /orchestrator-restapi
parent7d3713b4b93449cb81ae5869184f7596f4631de1 (diff)
Remove use of Optional
Diffstat (limited to 'orchestrator-restapi')
-rw-r--r--orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/wire/BatchHostSuspendRequest.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/wire/BatchHostSuspendRequest.java b/orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/wire/BatchHostSuspendRequest.java
index eca9e10f3b7..8311967e1bb 100644
--- a/orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/wire/BatchHostSuspendRequest.java
+++ b/orchestrator-restapi/src/main/java/com/yahoo/vespa/orchestrator/restapi/wire/BatchHostSuspendRequest.java
@@ -7,34 +7,33 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.concurrent.Immutable;
import java.util.Collections;
import java.util.List;
-import java.util.Optional;
@Immutable
public class BatchHostSuspendRequest {
public static final String PARENT_HOSTNAME_FIELD = "parentHostname";
public static final String HOSTNAMES_FIELD = "hostnames";
- public final Optional<String> parentHostname;
- public final Optional<List<String>> hostnames;
+ public final String parentHostname;
+ public final List<String> hostnames;
@JsonCreator
public BatchHostSuspendRequest(
@JsonProperty(PARENT_HOSTNAME_FIELD) String parentHostname,
@JsonProperty(HOSTNAMES_FIELD) List<String> hostnames) {
- this.parentHostname = Optional.ofNullable(parentHostname);
- this.hostnames = Optional.ofNullable(hostnames).map(Collections::unmodifiableList);
+ this.parentHostname = parentHostname;
+ this.hostnames = Collections.unmodifiableList(hostnames);
}
/**
* @return The hostname of the parent of the hostnames, if applicable, which can be used for debugging.
*/
@JsonProperty(PARENT_HOSTNAME_FIELD)
- public Optional<String> getParentHostname() {
+ public String getParentHostname() {
return parentHostname;
}
@JsonProperty(HOSTNAMES_FIELD)
- public Optional<List<String>> getHostnames() {
+ public List<String> getHostnames() {
return hostnames;
}