2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.pcep;
12 import com.google.common.collect.Maps;
14 public enum TerminationReason {
15 Unknown((short) 1), ExpDeadtimer((short) 2), MalformedMsg((short) 3), TooManyUnknownReqRep((short) 4), TooManyUnknownMsg((short) 5);
18 static Map<Short, TerminationReason> valueMap;
21 valueMap = Maps.newHashMap();
22 for (final TerminationReason enumItem : TerminationReason.values()) {
23 valueMap.put(enumItem.value, enumItem);
27 private TerminationReason(final short value) {
32 * @return integer value
34 public short getShortValue() {
40 * @return corresponding TerminationReason item
42 public static TerminationReason forValue(final short valueArg) {
43 return valueMap.get(valueArg);