/* * Copyright (c) 2015 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.rib.impl; import com.google.common.primitives.UnsignedInteger; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeAttrBuilder; final class SimpleRouteEntry extends AbstractRouteEntry { @Override boolean removeRoute(UnsignedInteger routerId) { return removeRoute(getOffsets().offsetOf(routerId)); } @Override protected MapEntryNode createValue(final PathArgument routeId) { final DataContainerNodeAttrBuilder b = Builders.mapEntryBuilder(); b.withNodeIdentifier((NodeIdentifierWithPredicates) routeId); b.addChild(attributes()); return b.build(); } }