Allow VpnProfile objects to be cloned
authorTobias Brunner <tobias@strongswan.org>
Tue, 7 Aug 2012 16:44:36 +0000 (18:44 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 13 Aug 2012 09:00:26 +0000 (11:00 +0200)
src/frontends/android/src/org/strongswan/android/data/VpnProfile.java

index 3e248d2..053f915 100644 (file)
@@ -17,7 +17,7 @@
 
 package org.strongswan.android.data;
 
-public class VpnProfile
+public class VpnProfile implements Cloneable
 {
        private String mName, mGateway, mUsername, mPassword, mCertificate;
        private long mId = -1;
@@ -97,4 +97,17 @@ public class VpnProfile
                }
                return false;
        }
+
+       @Override
+       public VpnProfile clone()
+       {
+               try
+               {
+                       return (VpnProfile)super.clone();
+               }
+               catch (CloneNotSupportedException e)
+               {
+                       throw new AssertionError();
+               }
+       }
 }