Drop <R, I> generic from RIBSupport
[bgpcep.git] / bgp / rib-spi / src / main / java / org / opendaylight / protocol / bgp / rib / spi / SimpleRIBExtensionProviderContext.java
index 648a49323739d2785a4415c4fe2e4cf6fbe19502..626325a2f9780374bf1d8a07104a70f734c13d3a 100644 (file)
@@ -12,7 +12,6 @@ import static java.util.Objects.requireNonNull;
 
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.Route;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.Tables;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.TablesKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.tables.Routes;
@@ -21,8 +20,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yangtools.yang.binding.ChildOf;
 import org.opendaylight.yangtools.yang.binding.ChoiceIn;
 import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.Identifiable;
-import org.opendaylight.yangtools.yang.binding.Identifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -30,16 +27,15 @@ import org.slf4j.LoggerFactory;
 public class SimpleRIBExtensionProviderContext implements RIBExtensionProviderContext {
     private static final Logger LOG = LoggerFactory.getLogger(SimpleRIBExtensionProviderContext.class);
 
-    private final ConcurrentMap<TablesKey, RIBSupport<?, ?, ?, ?>> supports = new ConcurrentHashMap<>();
-    private final ConcurrentMap<NodeIdentifierWithPredicates, RIBSupport<?, ?, ?, ?>> domSupports =
-            new ConcurrentHashMap<>();
+    private final ConcurrentMap<TablesKey, RIBSupport<?, ?>> supports = new ConcurrentHashMap<>();
+    private final ConcurrentMap<NodeIdentifierWithPredicates, RIBSupport<?, ?>> domSupports = new ConcurrentHashMap<>();
 
     @Override
-    public <T extends RIBSupport<?, ?, ?, ?>> RIBSupportRegistration<T> registerRIBSupport(
+    public <T extends RIBSupport<?, ?>> RIBSupportRegistration<T> registerRIBSupport(
             final Class<? extends AddressFamily> afi, final Class<? extends SubsequentAddressFamily> safi,
             final T support) {
         final TablesKey key = new TablesKey(afi, safi);
-        final RIBSupport<?, ?, ?, ?> prev = this.supports.putIfAbsent(key, support);
+        final RIBSupport<?, ?> prev = this.supports.putIfAbsent(key, support);
         checkArgument(prev == null, "AFI %s SAFI %s is already registered with %s", afi, safi, prev);
         this.domSupports.put(RibSupportUtils.toYangTablesKey(afi, safi), support);
         return new AbstractRIBSupportRegistration<>(support) {
@@ -52,25 +48,22 @@ public class SimpleRIBExtensionProviderContext implements RIBExtensionProviderCo
     }
 
     @Override
-    public <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<C>,
-        R extends Route & ChildOf<S> & Identifiable<I>, I extends Identifier<R>> RIBSupport<C, S, R, I> getRIBSupport(
+    public <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<C>> RIBSupport<C, S> getRIBSupport(
             final Class<? extends AddressFamily> afi, final Class<? extends SubsequentAddressFamily> safi) {
         return getRIBSupport(new TablesKey(afi, safi));
     }
 
     @Override
     @SuppressWarnings("unchecked")
-    public <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<C>,
-        R extends Route & ChildOf<S> & Identifiable<I>, I extends Identifier<R>> RIBSupport<C, S, R, I> getRIBSupport(
+    public <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<C>> RIBSupport<C, S> getRIBSupport(
             final TablesKey key) {
-        return (RIBSupport<C, S, R, I>) this.supports.get(requireNonNull(key));
+        return (RIBSupport<C, S>) this.supports.get(requireNonNull(key));
     }
 
     @Override
     @SuppressWarnings("unchecked")
-    public <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<C>,
-        R extends Route & ChildOf<S> & Identifiable<I>, I extends Identifier<R>> RIBSupport<C, S, R, I> getRIBSupport(
+    public <C extends Routes & DataObject & ChoiceIn<Tables>, S extends ChildOf<C>> RIBSupport<C, S> getRIBSupport(
             final NodeIdentifierWithPredicates key) {
-        return (RIBSupport<C, S, R, I>) this.domSupports.get(key);
+        return (RIBSupport<C, S>) this.domSupports.get(key);
     }
 }