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 ErrorTag. |
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="ErrorTag"> |
| 32 | * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> |
| 33 | * <enumeration value="in-use"/> |
| 34 | * <enumeration value="invalid-value"/> |
| 35 | * <enumeration value="too-big"/> |
| 36 | * <enumeration value="missing-attribute"/> |
| 37 | * <enumeration value="bad-attribute"/> |
| 38 | * <enumeration value="unknown-attribute"/> |
| 39 | * <enumeration value="missing-element"/> |
| 40 | * <enumeration value="bad-element"/> |
| 41 | * <enumeration value="unknown-element"/> |
| 42 | * <enumeration value="unknown-namespace"/> |
| 43 | * <enumeration value="access-denied"/> |
| 44 | * <enumeration value="lock-denied"/> |
| 45 | * <enumeration value="resource-denied"/> |
| 46 | * <enumeration value="rollback-failed"/> |
| 47 | * <enumeration value="data-exists"/> |
| 48 | * <enumeration value="data-missing"/> |
| 49 | * <enumeration value="operation-not-supported"/> |
| 50 | * <enumeration value="operation-failed"/> |
| 51 | * <enumeration value="partial-operation"/> |
| 52 | * <enumeration value="malformed-message"/> |
| 53 | * </restriction> |
| 54 | * </simpleType> |
| 55 | * </pre> |
| 56 | * |
| 57 | */ |
| 58 | @XmlType(name = "ErrorTag") |
| 59 | @XmlEnum |
| 60 | public enum ErrorTag { |
| 61 | |
| 62 | @XmlEnumValue("in-use") |
| 63 | IN_USE("in-use"), |
| 64 | @XmlEnumValue("invalid-value") |
| 65 | INVALID_VALUE("invalid-value"), |
| 66 | @XmlEnumValue("too-big") |
| 67 | TOO_BIG("too-big"), |
| 68 | @XmlEnumValue("missing-attribute") |
| 69 | MISSING_ATTRIBUTE("missing-attribute"), |
| 70 | @XmlEnumValue("bad-attribute") |
| 71 | BAD_ATTRIBUTE("bad-attribute"), |
| 72 | @XmlEnumValue("unknown-attribute") |
| 73 | UNKNOWN_ATTRIBUTE("unknown-attribute"), |
| 74 | @XmlEnumValue("missing-element") |
| 75 | MISSING_ELEMENT("missing-element"), |
| 76 | @XmlEnumValue("bad-element") |
| 77 | BAD_ELEMENT("bad-element"), |
| 78 | @XmlEnumValue("unknown-element") |
| 79 | UNKNOWN_ELEMENT("unknown-element"), |
| 80 | @XmlEnumValue("unknown-namespace") |
| 81 | UNKNOWN_NAMESPACE("unknown-namespace"), |
| 82 | @XmlEnumValue("access-denied") |
| 83 | ACCESS_DENIED("access-denied"), |
| 84 | @XmlEnumValue("lock-denied") |
| 85 | LOCK_DENIED("lock-denied"), |
| 86 | @XmlEnumValue("resource-denied") |
| 87 | RESOURCE_DENIED("resource-denied"), |
| 88 | @XmlEnumValue("rollback-failed") |
| 89 | ROLLBACK_FAILED("rollback-failed"), |
| 90 | @XmlEnumValue("data-exists") |
| 91 | DATA_EXISTS("data-exists"), |
| 92 | @XmlEnumValue("data-missing") |
| 93 | DATA_MISSING("data-missing"), |
| 94 | @XmlEnumValue("operation-not-supported") |
| 95 | OPERATION_NOT_SUPPORTED("operation-not-supported"), |
| 96 | @XmlEnumValue("operation-failed") |
| 97 | OPERATION_FAILED("operation-failed"), |
| 98 | @XmlEnumValue("partial-operation") |
| 99 | PARTIAL_OPERATION("partial-operation"), |
| 100 | @XmlEnumValue("malformed-message") |
| 101 | MALFORMED_MESSAGE("malformed-message"); |
| 102 | private final String value; |
| 103 | |
| 104 | ErrorTag(String v) { |
| 105 | value = v; |
| 106 | } |
| 107 | |
| 108 | public String value() { |
| 109 | return value; |
| 110 | } |
| 111 | |
| 112 | public static ErrorTag fromValue(String v) { |
| 113 | for (ErrorTag c: ErrorTag.values()) { |
| 114 | if (c.value.equals(v)) { |
| 115 | return c; |
| 116 | } |
| 117 | } |
| 118 | throw new IllegalArgumentException(v); |
| 119 | } |
| 120 | |
| 121 | } |