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.bgp.util;
10 import org.opendaylight.protocol.bgp.concepts.BaseBGPObjectState;
11 import org.opendaylight.protocol.bgp.parser.BGPPrefix;
12 import org.opendaylight.protocol.bgp.parser.BGPPrefixState;
14 import org.opendaylight.protocol.concepts.NetworkAddress;
15 import org.opendaylight.protocol.bgp.linkstate.PrefixIdentifier;
16 import org.opendaylight.protocol.bgp.linkstate.NetworkPrefixState;
17 import com.google.common.base.Preconditions;
20 * Super class for BGPIpvXPrefixImpl.
22 * @param <T> extends NetworkAddress<T>
24 public abstract class AbstractBGPPrefix<T extends NetworkAddress<T>> extends AbstractBGPObject implements BGPPrefix<T> {
25 private static final long serialVersionUID = 1L;
26 private final PrefixIdentifier<T> descriptor;
28 protected AbstractBGPPrefix(final BaseBGPObjectState base, final PrefixIdentifier<T> descriptor, final NetworkPrefixState prefixState) {
29 super(new BGPPrefixState(base, prefixState));
30 Preconditions.checkNotNull(descriptor);
31 this.descriptor = descriptor;
35 public final PrefixIdentifier<T> getPrefixIdentifier() {
36 return this.descriptor;
40 final public BGPPrefixState currentState() {
41 return (BGPPrefixState) super.currentState();