diff options
author | Samuel Holland <samuel@sholland.org> | 2018-01-08 04:08:21 -0600 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2018-01-08 04:25:15 -0600 |
commit | ec81014c4e6e305b4720ecdf108f67a83990e14a (patch) | |
tree | 619e591cf9a5335f03599f0141c441adf967fe75 /app/src | |
parent | d645d698475f986d8be8a0c9c96f2cd9b5dd153d (diff) |
Tunnel: Add a State factory method
Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/com/wireguard/android/model/Tunnel.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/java/com/wireguard/android/model/Tunnel.java b/app/src/main/java/com/wireguard/android/model/Tunnel.java index 6edb6acd..67c5144e 100644 --- a/app/src/main/java/com/wireguard/android/model/Tunnel.java +++ b/app/src/main/java/com/wireguard/android/model/Tunnel.java @@ -129,7 +129,11 @@ public class Tunnel extends BaseObservable implements Keyed<String> { public enum State { DOWN, TOGGLE, - UP + UP; + + public static State of(final boolean running) { + return running ? UP : DOWN; + } } public static class Statistics extends BaseObservable { |