BUG-5844: Fix ComplexRouteEntry creation
[bgpcep.git] / bgp / path-selection-mode / src / main / java / org / opendaylight / protocol / bgp / mode / impl / base / BaseSimpleRouteEntry.java
1 /*
2  * Copyright (c) 2015 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.mode.impl.base;
9
10 import com.google.common.primitives.UnsignedInteger;
11 import org.opendaylight.protocol.bgp.mode.api.BestPath;
12 import org.opendaylight.protocol.bgp.mode.spi.RouteEntryUtil;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
14 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
15
16 final class BaseSimpleRouteEntry extends BaseAbstractRouteEntry {
17     @Override
18     public boolean removeRoute(UnsignedInteger routerId, final Long remotePathId) {
19         return removeRoute(routerId, getOffsets().offsetOf(routerId));
20     }
21
22     @Override
23     public MapEntryNode createValue(final PathArgument routeId, final BestPath path) {
24         return RouteEntryUtil.createSimpleRouteValue(routeId, path);
25     }
26 }