diff options
Diffstat (limited to 'hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java')
-rw-r--r-- | hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java b/hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java index 177c72107e0..9eae9a33cff 100644 --- a/hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java +++ b/hosted-api/src/main/java/ai/vespa/hosted/api/DeploymentLog.java @@ -4,6 +4,7 @@ package ai.vespa.hosted.api; import java.time.Instant; import java.util.List; import java.util.OptionalLong; +import java.util.stream.Stream; import static java.util.Comparator.comparing; import static java.util.stream.Collectors.toUnmodifiableList; @@ -27,6 +28,14 @@ public class DeploymentLog { this.last = last; } + /** Returns this log updated with the content of the other. */ + public DeploymentLog updatedWith(DeploymentLog other) { + return new DeploymentLog(Stream.concat(entries.stream(), other.entries.stream()).collect(toUnmodifiableList()), + other.active, + other.status, + other.last); + } + public List<Entry> entries() { return entries; } |