1 /*******************************************************************************
2 * ============LICENSE_START========================================================================
3 * ONAP : ccsdk feature sdnr wt
4 * =================================================================================================
5 * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6 * =================================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software distributed under the License
13 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14 * or implied. See the License for the specific language governing permissions and limitations under
16 * ============LICENSE_END==========================================================================
17 ******************************************************************************/
22 package org.onap.ccsdk.features.sdnr.wt.devicemanager.base.internalTypes;
24 import javax.annotation.Nullable;
26 public enum InternalSeverity {
34 public boolean isNoAlarmIndication() {
35 return this == NonAlarmed;
38 public String getValueAsString() {
43 public String toString() {
47 public String toNetconfString()
62 return "not-specified";
66 * convert ONF 1.2 Severity
67 * @param severity as input
68 * @return String with related output
70 public static InternalSeverity valueOf(org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.SeverityType severity ) {
73 return InternalSeverity.NonAlarmed;
75 return InternalSeverity.Warning;
77 return InternalSeverity.Minor;
79 return InternalSeverity.Major;
81 return InternalSeverity.Critical;
87 * convert ONF 1.2.1.1 Severity
88 * @param severity as input
89 * @return String with related output
91 public static InternalSeverity valueOf(org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.SeverityType severity ) {
94 return InternalSeverity.NonAlarmed;
96 return InternalSeverity.Warning;
98 return InternalSeverity.Minor;
100 return InternalSeverity.Major;
102 return InternalSeverity.Critical;
108 * convert ONF 1.2.1.1p Severity
109 * @param severity as input
110 * @return String with related output
112 public static InternalSeverity valueOf(org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.SeverityType severity ) {
115 return InternalSeverity.NonAlarmed;
117 return InternalSeverity.Warning;
119 return InternalSeverity.Minor;
121 return InternalSeverity.Major;
123 return InternalSeverity.Critical;
129 * convert a text string into Severity
130 * @param severityString with textes non[-]alarmed, warning minor major critical
131 * @return related enum or null
133 public static @Nullable InternalSeverity valueOfString(String severityString) {
135 switch( severityString.toLowerCase().trim() ) {
138 return InternalSeverity.NonAlarmed;
140 return InternalSeverity.Warning;
142 return InternalSeverity.Minor;
144 return InternalSeverity.Major;
146 return InternalSeverity.Critical;