All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.yamcs.actions.ActionResult Maven / Gradle / Ivy

There is a newer version: 5.10.9
Show newest version
package org.yamcs.actions;

import java.util.concurrent.CompletableFuture;

import com.google.gson.JsonObject;

public class ActionResult {

    private CompletableFuture future = new CompletableFuture<>();

    /**
     * Complete successfully, without response message.
     * 

* Shortcut for {@code complete(null)} */ public void complete() { complete(null); } /** * Complete successfully * * @param result * the result value (may be null) */ public void complete(JsonObject result) { future.complete(result); } /** * Complete with an exception */ public void completeExceptionally(Throwable t) { future.completeExceptionally(t); } /** * Return the underlying future. */ public CompletableFuture future() { return future; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy