Yuta HIGUCHI | d1c413b | 2018-02-20 14:52:00 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 5 | * use this file except in compliance with the License. You may obtain a copy |
| 6 | * 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, WITHOUT |
| 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | * License for the specific language governing permissions and limitations under |
| 14 | * the License. |
| 15 | */ |
| 16 | // CHECKSTYLE:OFF |
| 17 | |
| 18 | package org.onosproject.netconf.rpc; |
| 19 | |
| 20 | import javax.xml.bind.annotation.XmlEnum; |
| 21 | import javax.xml.bind.annotation.XmlEnumValue; |
| 22 | import javax.xml.bind.annotation.XmlType; |
| 23 | |
| 24 | |
| 25 | /** |
Thomas Vachuska | a01ef78 | 2018-07-25 14:07:11 -0700 | [diff] [blame^] | 26 | * Java class for ErrorType. |
Yuta HIGUCHI | d1c413b | 2018-02-20 14:52:00 -0800 | [diff] [blame] | 27 | * |
Thomas Vachuska | a01ef78 | 2018-07-25 14:07:11 -0700 | [diff] [blame^] | 28 | * <p>The following schema fragment specifies the expected content contained within this class. |
| 29 | * </p> |
Yuta HIGUCHI | d1c413b | 2018-02-20 14:52:00 -0800 | [diff] [blame] | 30 | * <pre> |
| 31 | * <simpleType name="ErrorType"> |
| 32 | * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> |
| 33 | * <enumeration value="transport"/> |
| 34 | * <enumeration value="rpc"/> |
| 35 | * <enumeration value="protocol"/> |
| 36 | * <enumeration value="application"/> |
| 37 | * </restriction> |
| 38 | * </simpleType> |
| 39 | * </pre> |
| 40 | * |
| 41 | */ |
| 42 | @XmlType(name = "ErrorType") |
| 43 | @XmlEnum |
| 44 | public enum ErrorType { |
| 45 | |
| 46 | @XmlEnumValue("transport") |
| 47 | TRANSPORT("transport"), |
| 48 | @XmlEnumValue("rpc") |
| 49 | RPC("rpc"), |
| 50 | @XmlEnumValue("protocol") |
| 51 | PROTOCOL("protocol"), |
| 52 | @XmlEnumValue("application") |
| 53 | APPLICATION("application"); |
| 54 | private final String value; |
| 55 | |
| 56 | ErrorType(String v) { |
| 57 | value = v; |
| 58 | } |
| 59 | |
| 60 | public String value() { |
| 61 | return value; |
| 62 | } |
| 63 | |
| 64 | public static ErrorType fromValue(String v) { |
| 65 | for (ErrorType c: ErrorType.values()) { |
| 66 | if (c.value.equals(v)) { |
| 67 | return c; |
| 68 | } |
| 69 | } |
| 70 | throw new IllegalArgumentException(v); |
| 71 | } |
| 72 | |
| 73 | } |