summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard/android/model/Tunnel.java
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2018-01-07 01:22:31 -0600
committerSamuel Holland <samuel@sholland.org>2018-01-07 01:22:31 -0600
commit30396b87187193a3582dba2f149fe6206aeccbfc (patch)
treeaddc28dddffa9846f956c0c24283750ca4fb38d9 /app/src/main/java/com/wireguard/android/model/Tunnel.java
parente70b242c016709c41a09114996806fbdef30dd80 (diff)
model: Allow renaming tunnels
Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'app/src/main/java/com/wireguard/android/model/Tunnel.java')
-rw-r--r--app/src/main/java/com/wireguard/android/model/Tunnel.java6
1 files changed, 6 insertions, 0 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 e61ea095..9cdcf71f 100644
--- a/app/src/main/java/com/wireguard/android/model/Tunnel.java
+++ b/app/src/main/java/com/wireguard/android/model/Tunnel.java
@@ -112,6 +112,12 @@ public class Tunnel extends BaseObservable implements Keyed<String> {
notifyPropertyChanged(BR.statistics);
}
+ public CompletionStage<Tunnel> rename(@NonNull final String name) {
+ if (!name.equals(this.name))
+ return manager.rename(this, name);
+ return CompletableFuture.completedFuture(this);
+ }
+
public CompletionStage<Config> setConfig(@NonNull final Config config) {
if (!config.equals(this.config))
return manager.setTunnelConfig(this, config);