1 /***
2 * Java DAB EPG API - Serialize/Deserialize To/From POJOs to XML/Binary as per
3 * ETSI specifications TS 102 818 (XML Specification for DAB EPG) and TS 102
4 * 371 (Transportation and Binary Encoding Specification for EPG).
5 *
6 * Copyright (C) 2007 GCap Media PLC
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22 package com.gcapmedia.dab.epg;
23
24 /***
25 *
26 */
27 public enum Recommendation {
28
29 YES("yes"),
30
31 NO("no");
32
33 private final String value;
34
35 /***
36 * Create a new recommendation type
37 */
38 private Recommendation(String v) {
39 value = v;
40 }
41
42 /***
43 * @return Returns the string value of the enum
44 */
45 public String value() {
46 return value;
47 }
48
49 /***
50 * Parse the type from a string value
51 */
52 public static Recommendation fromValue(String v) {
53 for (Recommendation c: Recommendation.values()) {
54 if (c.value.equals(v)) {
55 return c;
56 }
57 }
58 throw new IllegalArgumentException(v);
59 }
60
61 /***
62 * @see java.lang.Enum#toString()
63 */
64 public String toString() {
65 return value;
66 }
67
68 }