Debian Codegraph @

src/main/java/ezvcard/parameter/RelatedType.java

raw symbols SCIP
1 package ezvcard.parameter;
2
3 import java.util.Collection;
4
5 import ezvcard.property.Related;
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 * Represents the TYPE parameter of the {@link Related} property.
38 * <p>
39 * <b>Supported versions:</b> {@code 4.0}
40 * </p>
41 * @author Michael Angstadt
42 */
43 public class RelatedType extends VCardParameter {
44 private static final VCardParameterCaseClasses<RelatedType> enums = new VCardParameterCaseClasses<>(RelatedType.class);
45
46 public static final RelatedType ACQUAINTANCE = new RelatedType("acquaintance");
47 public static final RelatedType AGENT = new RelatedType("agent");
48 public static final RelatedType CHILD = new RelatedType("child");
49 public static final RelatedType CO_RESIDENT = new RelatedType("co-resident");
50 public static final RelatedType CO_WORKER = new RelatedType("co-worker");
51 public static final RelatedType COLLEAGUE = new RelatedType("colleague");
52 public static final RelatedType CONTACT = new RelatedType("contact");
53 public static final RelatedType CRUSH = new RelatedType("crush");
54 public static final RelatedType DATE = new RelatedType("date");
55 public static final RelatedType EMERGENCY = new RelatedType("emergency");
56 public static final RelatedType FRIEND = new RelatedType("friend");
57 public static final RelatedType KIN = new RelatedType("kin");
58 public static final RelatedType ME = new RelatedType("me");
59 public static final RelatedType MET = new RelatedType("met");
60 public static final RelatedType MUSE = new RelatedType("muse");
61 public static final RelatedType NEIGHBOR = new RelatedType("neighbor");
62 public static final RelatedType PARENT = new RelatedType("parent");
63 public static final RelatedType SIBLING = new RelatedType("sibling");
64 public static final RelatedType SPOUSE = new RelatedType("spouse");
65 public static final RelatedType SWEETHEART = new RelatedType("sweetheart");
66
67 private RelatedType(String value) {
68 super(value);
69 }
70
71 /**
72 * Searches for a parameter value that is defined as a static constant in
73 * this class.
74 * @param value the parameter value
75 * @return the object or null if not found
76 */
77 public static RelatedType find(String value) {
78 return enums.find(value);
79 }
80
81 /**
82 * Searches for a parameter value and creates one if it cannot be found. All
83 * objects are guaranteed to be unique, so they can be compared with
84 * {@code ==} equality.
85 * @param value the parameter value
86 * @return the object
87 */
88 public static RelatedType get(String value) {
89 return enums.get(value);
90 }
91
92 /**
93 * Gets all of the parameter values that are defined as static constants in
94 * this class.
95 * @return the parameter values
96 */
97 public static Collection<RelatedType> all() {
98 return enums.all();
99 }
100 }