return this.errorId;
}
- /**
- * Caret for combination of Error-type and Error-value
- */
- static class BGPErrorIdentifier {
- private final short code;
- private final short subcode;
-
- BGPErrorIdentifier(final short code, final short subcode) {
- this.code = code;
- this.subcode = subcode;
- }
-
- public short getCode() {
- return this.code;
- }
-
- public short getSubCode() {
- return this.subcode;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + this.code;
- result = prime * result + this.subcode;
- return result;
- }
-
- @Override
- public boolean equals(final java.lang.Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (this.getClass() != obj.getClass()) {
- return false;
- }
- final BGPErrorIdentifier other = (BGPErrorIdentifier) obj;
- if (this.code != other.code) {
- return false;
- }
- if (this.subcode != other.subcode) {
- return false;
- }
- return true;
- }
-
- @Override
- public String toString() {
- return "type " + this.code + " value " + this.subcode;
- }
- }
-
public static BGPError forValue(final int code, final int subcode) {
final BGPError e = VALUE_MAP.get(new BGPErrorIdentifier((short) code, (short) subcode));
if (e != null) {
--- /dev/null
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.protocol.bgp.parser;
+
+/**
+ * Caret for combination of Error-type and Error-value
+ */
+final class BGPErrorIdentifier {
+ private final short code;
+ private final short subcode;
+
+ BGPErrorIdentifier(final short code, final short subcode) {
+ this.code = code;
+ this.subcode = subcode;
+ }
+
+ public short getCode() {
+ return this.code;
+ }
+
+ public short getSubCode() {
+ return this.subcode;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + this.code;
+ result = prime * result + this.subcode;
+ return result;
+ }
+
+ @Override
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (this.getClass() != obj.getClass()) {
+ return false;
+ }
+ final BGPErrorIdentifier other = (BGPErrorIdentifier) obj;
+ if (this.code != other.code) {
+ return false;
+ }
+ if (this.subcode != other.subcode) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "type " + this.code + " value " + this.subcode;
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.protocol.pcep.spi;
+
+/**
+ * Caret for combination of Error-type and Error-value
+ */
+final class PCEPErrorIdentifier {
+ private final short type;
+ private final short value;
+
+ PCEPErrorIdentifier(final short type, final short value) {
+ this.type = type;
+ this.value = value;
+ }
+
+ public short getType() {
+ return this.type;
+ }
+
+ public short getValue() {
+ return this.value;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + this.type;
+ result = prime * result + this.value;
+ return result;
+ }
+
+ @Override
+ public boolean equals(final java.lang.Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (this.getClass() != obj.getClass()) {
+ return false;
+ }
+ final PCEPErrorIdentifier other = (PCEPErrorIdentifier) obj;
+ if (this.type != other.type) {
+ return false;
+ }
+ if (this.value != other.value) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "type " + this.type + " value " + this.value;
+ }
+}
import com.google.common.collect.Maps;
import java.util.Map;
-
-
-
/**
* Possible errors listed in RFC5440, RFC 5455 and stateful draft.
*
public short getErrorValue() {
return this.errorId.getValue();
}
-
- /**
- * Caret for combination of Error-type and Error-value
- */
- static class PCEPErrorIdentifier {
- private final short type;
- private final short value;
-
- PCEPErrorIdentifier(final short type, final short value) {
- this.type = type;
- this.value = value;
- }
-
- public short getType() {
- return this.type;
- }
-
- public short getValue() {
- return this.value;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + this.type;
- result = prime * result + this.value;
- return result;
- }
-
- @Override
- public boolean equals(final java.lang.Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (this.getClass() != obj.getClass()) {
- return false;
- }
- final PCEPErrorIdentifier other = (PCEPErrorIdentifier) obj;
- if (this.type != other.type) {
- return false;
- }
- if (this.value != other.value) {
- return false;
- }
- return true;
- }
-
- @Override
- public String toString() {
- return "type " + this.type + " value " + this.value;
- }
- }
}