Tunnel: Add a State factory method

Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
Samuel Holland 2018-01-08 04:08:21 -06:00
parent d645d69847
commit ec81014c4e

View File

@ -129,7 +129,11 @@ public class Tunnel extends BaseObservable implements Keyed<String> {
public enum State { public enum State {
DOWN, DOWN,
TOGGLE, TOGGLE,
UP UP;
public static State of(final boolean running) {
return running ? UP : DOWN;
}
} }
public static class Statistics extends BaseObservable { public static class Statistics extends BaseObservable {