Debian Codegraph @

src/main/java/ezvcard/property/Organization.java

raw symbols SCIP
1 package ezvcard.property;
2
3 import java.util.List;
4
5 import ezvcard.parameter.Pid;
6
7 /*
8 Copyright (c) 2012-2023, Michael Angstadt
9 All rights reserved.
10
11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions are met:
13
14 1. Redistributions of source code must retain the above copyright notice, this
15 list of conditions and the following disclaimer.
16 2. Redistributions in binary form must reproduce the above copyright notice,
17 this list of conditions and the following disclaimer in the documentation
18 and/or other materials provided with the distribution.
19
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
24 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31 The views and conclusions contained in the software and documentation are those
32 of the authors and should not be interpreted as representing official policies,
33 either expressed or implied, of the FreeBSD Project.
34 */
35
36 /**
37 * <p>
38 * Defines a list of organizations the person belongs to. The list is ordered.
39 * It begins with the broadest organization and ends with the most specific.
40 * </p>
41 *
42 * <p>
43 * <b>Code sample</b>
44 * </p>
45 *
46 * <pre class="brush:java">
47 * VCard vcard = new VCard();
48 *
49 * Organization org = new Organization();
50 * org.getValues().add("Google");
51 * org.getValues().add("GMail Team");
52 * org.getValues().add("Spam Detection Team");
53 * vcard.setOrganization(org);
54 * </pre>
55 *
56 * <p>
57 * <b>Property name:</b> {@code ORG}
58 * </p>
59 * <p>
60 * <b>Supported versions:</b> {@code 2.1, 3.0, 4.0}
61 * </p>
62 * @author Michael Angstadt
63 * @see <a href="http://tools.ietf.org/html/rfc6350#page-40">RFC 6350 p.40</a>
64 * @see <a href="http://tools.ietf.org/html/rfc2426#page-20">RFC 2426 p.20</a>
65 * @see <a href="http://www.imc.org/pdi/vcard-21.doc">vCard 2.1 p.19</a>
66 */
67 public class Organization extends TextListProperty implements HasAltId {
68 public Organization() {
69 //empty
70 }
71
72 /**
73 * Copy constructor.
74 * @param original the property to make a copy of
75 */
76 public Organization(Organization original) {
77 super(original);
78 }
79
80 @Override
81 public String getLanguage() {
82 return super.getLanguage();
83 }
84
85 @Override
86 public void setLanguage(String language) {
87 super.setLanguage(language);
88 }
89
90 /**
91 * Gets the TYPE parameter.
92 * <p>
93 * <b>Supported versions:</b> {@code 4.0}
94 * </p>
95 * @return the TYPE value (typically, this will be either "work" or "home")
96 * or null if it doesn't exist
97 */
98 public String getType() {
99 return parameters.getType();
100 }
101
102 /**
103 * Sets the TYPE parameter.
104 * <p>
105 * <b>Supported versions:</b> {@code 4.0}
106 * </p>
107 * @param type the TYPE value (this should be either "work" or "home") or
108 * null to remove
109 */
110 public void setType(String type) {
111 parameters.setType(type);
112 }
113
114 @Override
115 public List<Pid> getPids() {
116 return super.getPids();
117 }
118
119 @Override
120 public Integer getPref() {
121 return super.getPref();
122 }
123
124 @Override
125 public void setPref(Integer pref) {
126 super.setPref(pref);
127 }
128
129 //@Override
130 public String getAltId() {
131 return parameters.getAltId();
132 }
133
134 //@Override
135 public void setAltId(String altId) {
136 parameters.setAltId(altId);
137 }
138
139 /**
140 * <p>
141 * Gets the list that holds string(s) which define how to sort the vCard.
142 * </p>
143 * <p>
144 * 2.1 and 3.0 vCards should use the {@link SortString} property instead.
145 * </p>
146 * <p>
147 * <b>Supported versions:</b> {@code 4.0}
148 * </p>
149 * @return the sort string(s) (this list is mutable)
150 */
151 public List<String> getSortAs() {
152 return parameters.getSortAs();
153 }
154
155 /**
156 * <p>
157 * Sets the sort string for this property.
158 * </p>
159 * <p>
160 * 2.1 and 3.0 vCards should use the {@link SortString} property instead.
161 * </p>
162 * <p>
163 * <b>Supported versions:</b> {@code 4.0}
164 * </p>
165 * @param sortString the sort string or null to remove
166 */
167 public void setSortAs(String sortString) {
168 parameters.setSortAs(sortString);
169 }
170
171 @Override
172 public Organization copy() {
173 return new Organization(this);
174 }
175 }