summaryrefslogtreecommitdiffhomepage
path: root/tunnel/src/main/java/com/wireguard/android/backend/Tunnel.java
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-09-16 16:12:59 +0530
committerJason A. Donenfeld <Jason@zx2c4.com>2020-09-16 18:01:06 +0200
commitff7d7e0edd9fbcafeea3bfb56c8d3a1f136efb56 (patch)
treeb3a7ef2ab041a1c52c46f9c2f58cd86038226aa2 /tunnel/src/main/java/com/wireguard/android/backend/Tunnel.java
parent2f088938c6c8c718d0a4ed639c18868257e354a1 (diff)
tunnel: document more public API from backend package
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'tunnel/src/main/java/com/wireguard/android/backend/Tunnel.java')
-rw-r--r--tunnel/src/main/java/com/wireguard/android/backend/Tunnel.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/tunnel/src/main/java/com/wireguard/android/backend/Tunnel.java b/tunnel/src/main/java/com/wireguard/android/backend/Tunnel.java
index a9761929..2f12f6c3 100644
--- a/tunnel/src/main/java/com/wireguard/android/backend/Tunnel.java
+++ b/tunnel/src/main/java/com/wireguard/android/backend/Tunnel.java
@@ -36,11 +36,20 @@ public interface Tunnel {
*/
void onStateChange(State newState);
+ /**
+ * Enum class to represent all possible states of a {@link Tunnel}.
+ */
enum State {
DOWN,
TOGGLE,
UP;
+ /**
+ * Get the state of a {@link Tunnel}
+ *
+ * @param running boolean indicating if the tunnel is running.
+ * @return State of the tunnel based on whether or not it is running.
+ */
public static State of(final boolean running) {
return running ? UP : DOWN;
}