android: Field added to store the type of a VPN profile
[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 VpnType mVpnType;
24 private long mId = -1;
25
26 public long getId()
27 {
28 return mId;
29 }
30
31 public void setId(long id)
32 {
33 this.mId = id;
34 }
35
36 public String getName()
37 {
38 return mName;
39 }
40
41 public void setName(String name)
42 {
43 this.mName = name;
44 }
45
46 public String getGateway()
47 {
48 return mGateway;
49 }
50
51 public void setGateway(String gateway)
52 {
53 this.mGateway = gateway;
54 }
55
56 public VpnType getVpnType()
57 {
58 return mVpnType;
59 }
60
61 public void setVpnType(VpnType type)
62 {
63 this.mVpnType = type;
64 }
65
66 public String getUsername()
67 {
68 return mUsername;
69 }
70
71 public void setUsername(String username)
72 {
73 this.mUsername = username;
74 }
75
76 public String getPassword()
77 {
78 return mPassword;
79 }
80
81 public void setPassword(String password)
82 {
83 this.mPassword = password;
84 }
85
86 public String getCertificateAlias()
87 {
88 return mCertificate;
89 }
90
91 public void setCertificateAlias(String alias)
92 {
93 this.mCertificate = alias;
94 }
95
96 public String getUserCertificateAlias()
97 {
98 return mUserCertificate;
99 }
100
101 public void setUserCertificateAlias(String alias)
102 {
103 this.mUserCertificate = alias;
104 }
105
106 @Override
107 public String toString()
108 {
109 return mName;
110 }
111
112 @Override
113 public boolean equals(Object o)
114 {
115 if (o != null && o instanceof VpnProfile)
116 {
117 return this.mId == ((VpnProfile)o).getId();
118 }
119 return false;
120 }
121
122 @Override
123 public VpnProfile clone()
124 {
125 try
126 {
127 return (VpnProfile)super.clone();
128 }
129 catch (CloneNotSupportedException e)
130 {
131 throw new AssertionError();
132 }
133 }
134 }