01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.commons.lang.enums;
18:
19: import java.util.Iterator;
20: import java.util.List;
21: import java.util.Map;
22:
23: /**
24: * Language enumeration.
25: *
26: * @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
27: * @version $Id: ValuedLanguageEnum.java 437554 2006-08-28 06:21:41Z bayard $
28: */
29: public final class ValuedLanguageEnum extends ValuedEnum {
30: public static final ValuedLanguageEnum ENGLISH = new ValuedLanguageEnum(
31: "English", 1);
32: public static final ValuedLanguageEnum FRENCH = new ValuedLanguageEnum(
33: "French", 2);
34: public static final ValuedLanguageEnum GERMAN = new ValuedLanguageEnum(
35: "German", 3);
36:
37: private ValuedLanguageEnum(String color, int value) {
38: super (color, value);
39: }
40:
41: public static ValuedLanguageEnum getEnum(String color) {
42: return (ValuedLanguageEnum) getEnum(ValuedLanguageEnum.class,
43: color);
44: }
45:
46: public static ValuedLanguageEnum getEnum(int value) {
47: return (ValuedLanguageEnum) getEnum(ValuedLanguageEnum.class,
48: value);
49: }
50:
51: public static Map getEnumMap() {
52: return getEnumMap(ValuedLanguageEnum.class);
53: }
54:
55: public static List getEnumList() {
56: return getEnumList(ValuedLanguageEnum.class);
57: }
58:
59: public static Iterator iterator() {
60: return iterator(ValuedLanguageEnum.class);
61: }
62: }
|