1 /*
2 * DavMail POP/IMAP/SMTP/CalDav/LDAP Exchange Gateway
3 * Copyright (C) 2010 Mickael Guessant
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 package davmail.exchange.dav;
20
21 /**
22 * Property value.
23 */
24 public class PropertyValue {
25 protected final String namespaceUri;
26 protected final String name;
27 protected final String xmlEncodedValue;
28 protected final String typeString;
29
30 /**
31 * Create Dav property value.
32 *
33 * @param namespaceUri property namespace
34 * @param name property name
35 */
36 public PropertyValue(String namespaceUri, String name) {
37 this(namespaceUri, name, null, null);
38 }
39
40 /**
41 * Create Dav property value.
42 *
43 * @param namespaceUri property namespace
44 * @param name property name
45 * @param xmlEncodedValue xml encoded value
46 */
47 public PropertyValue(String namespaceUri, String name, String xmlEncodedValue) {
48 this(namespaceUri, name, xmlEncodedValue, null);
49 }
50
51 /**
52 * Create Dav property value.
53 *
54 * @param namespaceUri property namespace
55 * @param name property name
56 * @param xmlEncodedValue xml encoded value
57 * @param typeString property type
58 */
59 public PropertyValue(String namespaceUri, String name, String xmlEncodedValue, String typeString) {
60 this.namespaceUri = namespaceUri;
61 this.name = name;
62 this.xmlEncodedValue = xmlEncodedValue;
63 this.typeString = typeString;
64 }
65
66 /**
67 * Get property namespace.
68 *
69 * @return property namespace
70 */
71 public String getNamespaceUri() {
72 return namespaceUri;
73 }
74
75 /**
76 * Get xml encoded value.
77 *
78 * @return Xml encoded value
79 */
80 public String getXmlEncodedValue() {
81 return xmlEncodedValue;
82 }
83
84 /**
85 * Get property type.
86 *
87 * @return property type
88 */
89 public String getTypeString() {
90 return typeString;
91 }
92
93 /**
94 * Get property name.
95 *
96 * @return property name
97 */
98 public String getName() {
99 return name;
100 }
101 }