Merge "BUG-2182 : included data-change-counter in feature file"
[bgpcep.git] / bgp / rib-spi / src / main / java / org / opendaylight / protocol / bgp / rib / spi / BGPTerminationReason.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.protocol.bgp.rib.spi;
9
10 import com.google.common.base.Objects;
11
12 import org.opendaylight.protocol.bgp.parser.BGPError;
13 import org.opendaylight.protocol.framework.TerminationReason;
14
15 public final class BGPTerminationReason implements TerminationReason {
16     private final BGPError error;
17
18     public BGPTerminationReason(final BGPError error) {
19         this.error = error;
20     }
21
22     @Override
23     public String getErrorMessage() {
24         return error.toString();
25     }
26
27     @Override
28     public String toString() {
29         return Objects.toStringHelper(this)
30                 .add("error", error)
31                 .toString();
32     }
33 }