fea9e5c9f3f93da5abeec9fd515af7dce6068ffb
[strongswan.git] / src / frontends / android / src / org / strongswan / android / data / VpnProfile.java
1 /*
2 * Copyright (C) 2012 Tobias Brunner
3 * Copyright (C) 2012 Giuliano Grassi
4 * Copyright (C) 2012 Ralf Sager
5 * Hochschule fuer Technik Rapperswil
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 */
17
18 package org.strongswan.android.data;
19
20 public class VpnProfile implements Cloneable
21 {
22 private String mName, mGateway, mUsername, mPassword, mCertificate, mUserCertificate;
23 private long mId = -1;
24
25 public long getId()
26 {
27 return mId;
28 }
29
30 public void setId(long id)
31 {
32 this.mId = id;
33 }
34
35 public String getName()
36 {
37 return mName;
38 }
39
40 public void setName(String name)
41 {
42 this.mName = name;
43 }
44
45 public String getGateway()
46 {
47 return mGateway;
48 }
49
50 public void setGateway(String gateway)
51 {
52 this.mGateway = gateway;
53 }
54
55 public String getUsername()
56 {
57 return mUsername;
58 }
59
60 public void setUsername(String username)
61 {
62 this.mUsername = username;
63 }
64
65 public String getPassword()
66 {
67 return mPassword;
68 }
69
70 public void setPassword(String password)
71 {
72 this.mPassword = password;
73 }
74
75 public String getCertificateAlias()
76 {
77 return mCertificate;
78 }
79
80 public void setCertificateAlias(String alias)
81 {
82 this.mCertificate = alias;
83 }
84
85 public String getUserCertificateAlias()
86 {
87 return mUserCertificate;
88 }
89
90 public void setUserCertificateAlias(String alias)
91 {
92 this.mUserCertificate = alias;
93 }
94
95 @Override
96 public String toString()
97 {
98 return mName;
99 }
100
101 @Override
102 public boolean equals(Object o)
103 {
104 if (o != null && o instanceof VpnProfile)
105 {
106 return this.mId == ((VpnProfile)o).getId();
107 }
108 return false;
109 }
110
111 @Override
112 public VpnProfile clone()
113 {
114 try
115 {
116 return (VpnProfile)super.clone();
117 }
118 catch (CloneNotSupportedException e)
119 {
120 throw new AssertionError();
121 }
122 }
123 }