diff options
author | Samuel Holland <samuel@sholland.org> | 2018-01-07 01:22:31 -0600 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2018-01-07 01:22:31 -0600 |
commit | 30396b87187193a3582dba2f149fe6206aeccbfc (patch) | |
tree | addc28dddffa9846f956c0c24283750ca4fb38d9 /app/src/main/java/com/wireguard/android/model/Tunnel.java | |
parent | e70b242c016709c41a09114996806fbdef30dd80 (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.java | 6 |
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); |