Debian Codegraph @

src/main/java/ezvcard/property/Expertise.java

raw symbols SCIP
1 package ezvcard.property;
2
3 import ezvcard.SupportedVersions;
4 import ezvcard.VCardVersion;
5 import ezvcard.parameter.ExpertiseLevel;
6 import ezvcard.parameter.VCardParameters;
7
8 /*
9 Copyright (c) 2012-2023, Michael Angstadt
10 All rights reserved.
11
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions are met:
14
15 1. Redistributions of source code must retain the above copyright notice, this
16 list of conditions and the following disclaimer.
17 2. Redistributions in binary form must reproduce the above copyright notice,
18 this list of conditions and the following disclaimer in the documentation
19 and/or other materials provided with the distribution.
20
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
25 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
32 The views and conclusions contained in the software and documentation are those
33 of the authors and should not be interpreted as representing official policies,
34 either expressed or implied, of the FreeBSD Project.
35 */
36
37 /**
38 * <p>
39 * Defines a professional subject area that the person has knowledge of. For
40 * example, if the person is a software engineer, he or she might list
41 * technologies such as "Java", "Web services", and
42 * "Agile development practices".
43 * </p>
44 *
45 * <p>
46 * <b>Code sample</b>
47 * </p>
48 *
49 * <pre class="brush:java">
50 * VCard vcard = new VCard();
51 *
52 * Expertise expertise = new Expertise("Java programming");
53 * expertise.setLevel(ExpertiseLevel.EXPERT);
54 * vcard.addExpertise(expertise);
55 * </pre>
56 *
57 * <p>
58 * <b>Property name:</b> {@code EXPERTISE}
59 * </p>
60 * <p>
61 * <b>Supported versions:</b> {@code 4.0}
62 * </p>
63 * @author Michael Angstadt
64 * @see <a href="http://tools.ietf.org/html/rfc6715#page-3">RFC 6715 p.3</a>
65 */
66 @SupportedVersions(VCardVersion.V4_0)
67 public class Expertise extends TextProperty implements HasAltId {
68 /**
69 * Creates an expertise property.
70 * @param skill the skill (e.g. "Java programming")
71 */
72 public Expertise(String skill) {
73 super(skill);
74 }
75
76 /**
77 * Copy constructor.
78 * @param original the property to make a copy of
79 */
80 public Expertise(Expertise original) {
81 super(original);
82 }
83
84 /**
85 * Gets the level of knowledge the person has for this skill.
86 * @return the skill level (e.g. "beginner") or null if not set
87 * @see VCardParameters#getLevel
88 */
89 public ExpertiseLevel getLevel() {
90 String value = parameters.getLevel();
91 return (value == null) ? null : ExpertiseLevel.get(value);
92 }
93
94 /**
95 * Sets the level of knowledge the person has for this skill.
96 * @param level the skill level (e.g. "beginner") or null to remove
97 * @see VCardParameters#setLevel
98 */
99 public void setLevel(ExpertiseLevel level) {
100 String value = (level == null) ? null : level.getValue();
101 parameters.setLevel(value);
102 }
103
104 @Override
105 public Integer getIndex() {
106 return super.getIndex();
107 }
108
109 @Override
110 public void setIndex(Integer index) {
111 super.setIndex(index);
112 }
113
114 /**
115 * Gets the TYPE parameter.
116 * @return the TYPE value (typically, this will be either "work" or "home")
117 * or null if it doesn't exist
118 */
119 public String getType() {
120 return parameters.getType();
121 }
122
123 /**
124 * Sets the TYPE parameter.
125 * @param type the TYPE value (this should be either "work" or "home") or
126 * null to remove
127 */
128 public void setType(String type) {
129 parameters.setType(type);
130 }
131
132 @Override
133 public String getLanguage() {
134 return super.getLanguage();
135 }
136
137 @Override
138 public void setLanguage(String language) {
139 super.setLanguage(language);
140 }
141
142 @Override
143 public Integer getPref() {
144 return super.getPref();
145 }
146
147 @Override
148 public void setPref(Integer pref) {
149 super.setPref(pref);
150 }
151
152 //@Override
153 public String getAltId() {
154 return parameters.getAltId();
155 }
156
157 //@Override
158 public void setAltId(String altId) {
159 parameters.setAltId(altId);
160 }
161
162 @Override
163 public Expertise copy() {
164 return new Expertise(this);
165 }
166 }