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;
10 import com.google.common.collect.Maps;
13 public enum TerminationReason {
15 EXP_DEADTIMER((short) 2),
16 MALFORMED_MSG((short) 3),
17 TOO_MANY_UNKNWN_REQS((short) 4),
18 TOO_MANY_UNKNOWN_MSGS((short) 5);
20 private static final Map<Short, TerminationReason> VALUE_MAP;
23 VALUE_MAP = Maps.newHashMap();
24 for (final TerminationReason enumItem : TerminationReason.values()) {
25 VALUE_MAP.put(enumItem.value, enumItem);
31 TerminationReason(final short value) {
36 * Gets termination reason for specific short value.
38 * @param valueArg corresponding to Termination reason
39 * @return corresponding TerminationReason item
41 public static TerminationReason forValue(final short valueArg) {
42 return VALUE_MAP.get(valueArg);
46 * Gets value of termination reason.
50 public short getShortValue() {