Debian Codegraph @

src/main/java/ezvcard/parameter/EmailType.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.Email;
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 Email} properties.
43 * <p>
44 * <b>Supported versions:</b> {@code 2.1, 3.0, 4.0}
45 * </p>
46 * @author Michael Angstadt
47 */
48 public class EmailType extends VCardParameter {
49 private static final VCardParameterCaseClasses<EmailType> enums = new VCardParameterCaseClasses<>(EmailType.class);
50
51 @SupportedVersions({ V2_1, V3_0 })
52 public static final EmailType INTERNET = new EmailType("internet");
53
54 @SupportedVersions({ V2_1, V3_0 })
55 public static final EmailType X400 = new EmailType("x400");
56
57 @SupportedVersions({ V2_1, V3_0 })
58 public static final EmailType PREF = new EmailType("pref");
59
60 @SupportedVersions(V2_1)
61 public static final EmailType AOL = new EmailType("aol");
62
63 @SupportedVersions(V2_1)
64 public static final EmailType APPLELINK = new EmailType("applelink");
65
66 @SupportedVersions(V2_1)
67 public static final EmailType ATTMAIL = new EmailType("attmail");
68
69 @SupportedVersions(V2_1)
70 public static final EmailType CIS = new EmailType("cis");
71
72 @SupportedVersions(V2_1)
73 public static final EmailType EWORLD = new EmailType("eworld");
74
75 @SupportedVersions(V2_1)
76 public static final EmailType IBMMAIL = new EmailType("ibmmail");
77
78 @SupportedVersions(V2_1)
79 public static final EmailType MCIMAIL = new EmailType("mcimail");
80
81 @SupportedVersions(V2_1)
82 public static final EmailType POWERSHARE = new EmailType("powershare");
83
84 @SupportedVersions(V2_1)
85 public static final EmailType PRODIGY = new EmailType("prodigy");
86
87 @SupportedVersions(V2_1)
88 public static final EmailType TLX = new EmailType("tlx");
89
90 @SupportedVersions(V4_0)
91 public static final EmailType HOME = new EmailType("home");
92
93 @SupportedVersions(V4_0)
94 public static final EmailType WORK = new EmailType("work");
95
96 private EmailType(String value) {
97 super(value);
98 }
99
100 /**
101 * Searches for a parameter value that is defined as a static constant in
102 * this class.
103 * @param value the parameter value
104 * @return the object or null if not found
105 */
106 public static EmailType find(String value) {
107 return enums.find(value);
108 }
109
110 /**
111 * Searches for a parameter value and creates one if it cannot be found. All
112 * objects are guaranteed to be unique, so they can be compared with
113 * {@code ==} equality.
114 * @param value the parameter value
115 * @return the object
116 */
117 public static EmailType get(String value) {
118 return enums.get(value);
119 }
120
121 /**
122 * Gets all of the parameter values that are defined as static constants in
123 * this class.
124 * @return the parameter values
125 */
126 public static Collection<EmailType> all() {
127 return enums.all();
128 }
129 }