View Javadoc
1   /*
2    * Copyright 2001-2008 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   */
17  package org.uddi.api_v2;
18  
19  import javax.xml.bind.annotation.XmlEnum;
20  import javax.xml.bind.annotation.XmlEnumValue;
21  import javax.xml.bind.annotation.XmlType;
22  
23  
24  /**
25   * <p>Java class for keyType.
26   * 
27   * <p>The following schema fragment specifies the expected content contained within this class.
28   * <p>
29   * <pre>
30   * &lt;simpleType name="keyType">
31   *   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
32   *     &lt;enumeration value="businessKey"/>
33   *     &lt;enumeration value="tModelKey"/>
34   *     &lt;enumeration value="serviceKey"/>
35   *     &lt;enumeration value="bindingKey"/>
36   *   &lt;/restriction>
37   * &lt;/simpleType>
38   * </pre>
39   * 
40   */
41  @XmlType(name = "keyType")
42  @XmlEnum
43  public enum KeyType {
44  
45      @XmlEnumValue("businessKey")
46      BUSINESS_KEY("businessKey"),
47      @XmlEnumValue("tModelKey")
48      T_MODEL_KEY("tModelKey"),
49      @XmlEnumValue("serviceKey")
50      SERVICE_KEY("serviceKey"),
51      @XmlEnumValue("bindingKey")
52      BINDING_KEY("bindingKey");
53      private final String value;
54  
55      KeyType(String v) {
56          value = v;
57      }
58  
59      public String value() {
60          return value;
61      }
62  
63      public static KeyType fromValue(String v) {
64          for (KeyType c: KeyType.values()) {
65              if (c.value.equals(v)) {
66                  return c;
67              }
68          }
69          throw new IllegalArgumentException(v);
70      }
71  
72  }