2 * Copyright (c) 2016 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
9 package org.opendaylight.protocol.bgp.mode.spi;
11 import static java.util.Objects.requireNonNull;
13 import com.google.common.annotations.VisibleForTesting;
14 import com.google.common.base.MoreObjects;
15 import org.opendaylight.protocol.bgp.mode.api.BestPath;
16 import org.opendaylight.protocol.bgp.mode.api.BestPathState;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
19 public abstract class AbstractBestPath implements BestPath {
20 protected final BestPathState state;
22 protected AbstractBestPath(final BestPathState state) {
23 this.state = requireNonNull(state);
26 protected abstract MoreObjects.ToStringHelper addToStringAttributes(MoreObjects.ToStringHelper toStringHelper);
29 public final BestPathState getState() {
34 public final Attributes getAttributes() {
35 return this.state.getAttributes();
39 public final String toString() {
40 return addToStringAttributes(MoreObjects.toStringHelper(this)).toString();