Debian Codegraph @

src/main/java/ezvcard/parameter/TelephoneType.java

raw symbols SCIP
1 package ezvcard.parameter;
2
3 import static ezvcard.VCardVersion.V2_1;
4 import static ezvcard.VCardVersion.V3_0;
5 import static ezvcard.VCardVersion.V4_0;
6
7 import java.util.Collection;
8
9 import ezvcard.SupportedVersions;
10 import ezvcard.property.Telephone;
11
12 /*
13 Copyright (c) 2012-2023, Michael Angstadt
14 All rights reserved.
15
16 Redistribution and use in source and binary forms, with or without
17 modification, are permitted provided that the following conditions are met:
18
19 1. Redistributions of source code must retain the above copyright notice, this
20 list of conditions and the following disclaimer.
21 2. Redistributions in binary form must reproduce the above copyright notice,
22 this list of conditions and the following disclaimer in the documentation
23 and/or other materials provided with the distribution.
24
25 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
26 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
29 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
32 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
36 The views and conclusions contained in the software and documentation are those
37 of the authors and should not be interpreted as representing official policies,
38 either expressed or implied, of the FreeBSD Project.
39 */
40
41 /**
42 * Represents the TYPE parameter of the {@link Telephone} property.
43 * <p>
44 * <b>Supported versions:</b> {@code 2.1, 3.0, 4.0}
45 * </p>
46 * @author Michael Angstadt
47 */
48 public class TelephoneType extends VCardParameter {
49 private static final VCardParameterCaseClasses<TelephoneType> enums = new VCardParameterCaseClasses<>(TelephoneType.class);
50
51 @SupportedVersions({ V2_1, V3_0 })
52 public static final TelephoneType BBS = new TelephoneType("bbs");
53
54 @SupportedVersions({ V2_1, V3_0 })
55 public static final TelephoneType CAR = new TelephoneType("car");
56
57 public static final TelephoneType CELL = new TelephoneType("cell");
58
59 public static final TelephoneType FAX = new TelephoneType("fax");
60
61 public static final TelephoneType HOME = new TelephoneType("home");
62
63 @SupportedVersions({ V2_1, V3_0 })
64 public static final TelephoneType ISDN = new TelephoneType("isdn");
65
66 @SupportedVersions({ V2_1, V3_0 })
67 public static final TelephoneType MODEM = new TelephoneType("modem");
68
69 @SupportedVersions({ V2_1, V3_0 })
70 public static final TelephoneType MSG = new TelephoneType("msg");
71
72 public static final TelephoneType PAGER = new TelephoneType("pager");
73
74 @SupportedVersions(V3_0)
75 public static final TelephoneType PCS = new TelephoneType("pcs");
76
77 @SupportedVersions({ V2_1, V3_0 })
78 public static final TelephoneType PREF = new TelephoneType("pref");
79
80 @SupportedVersions(V4_0)
81 public static final TelephoneType TEXT = new TelephoneType("text");
82
83 @SupportedVersions(V4_0)
84 public static final TelephoneType TEXTPHONE = new TelephoneType("textphone");
85
86 public static final TelephoneType VIDEO = new TelephoneType("video");
87
88 public static final TelephoneType VOICE = new TelephoneType("voice");
89
90 public static final TelephoneType WORK = new TelephoneType("work");
91
92 private TelephoneType(String value) {
93 super(value);
94 }
95
96 /**
97 * Searches for a parameter value that is defined as a static constant in
98 * this class.
99 * @param value the parameter value
100 * @return the object or null if not found
101 */
102 public static TelephoneType find(String value) {
103 return enums.find(value);
104 }
105
106 /**
107 * Searches for a parameter value and creates one if it cannot be found. All
108 * objects are guaranteed to be unique, so they can be compared with
109 * {@code ==} equality.
110 * @param value the parameter value
111 * @return the object
112 */
113 public static TelephoneType get(String value) {
114 return enums.get(value);
115 }
116
117 /**
118 * Gets all of the parameter values that are defined as static constants in
119 * this class.
120 * @return the parameter values
121 */
122 public static Collection<TelephoneType> all() {
123 return enums.all();
124 }
125 }