Fixup Augmentable and Identifiable methods changing 59/71259/11
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 24 Apr 2018 14:52:26 +0000 (16:52 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 4 Jun 2018 13:52:19 +0000 (15:52 +0200)
This is a fixup of the change in binding codegen, adjusting:
- getKey() -> key()
- setKey() -> withKey()
- getAugmentation() -> augmentation()

Change-Id: I0c43fd2ff1d7913718597ebf18d979842c4559c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
122 files changed:
bgp/benchmark-app/src/main/java/org/opendaylight/protocol/bgp/benchmark/app/AppPeerBenchmark.java
bgp/cli/src/main/java/org/opendaylight/protocol/bgp/cli/utils/BGPOperationalStateUtils.java
bgp/cli/src/main/java/org/opendaylight/protocol/bgp/cli/utils/GlobalStateCliUtils.java
bgp/cli/src/main/java/org/opendaylight/protocol/bgp/cli/utils/NeighborStateCliUtils.java
bgp/cli/src/main/java/org/opendaylight/protocol/bgp/cli/utils/PeerGroupStateCliUtils.java
bgp/evpn/src/main/java/org/opendaylight/protocol/bgp/evpn/impl/EvpnRibSupport.java
bgp/evpn/src/main/java/org/opendaylight/protocol/bgp/evpn/impl/nlri/EvpnNlriParser.java
bgp/evpn/src/test/java/org/opendaylight/protocol/bgp/evpn/impl/EvpnRibSupportTest.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecNlriParser.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv4RIBSupport.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv6RIBSupport.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/ipv4/FlowspecL3vpnIpv4RIBSupport.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/l3vpn/ipv6/FlowspecL3vpnIpv6RIBSupport.java
bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv4RIBSupportTest.java
bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecIpv6RIBSupportTest.java
bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv4RIBSupportTest.java
bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/FlowspecL3vpnIpv6RIBSupportTest.java
bgp/inet/src/main/java/org/opendaylight/protocol/bgp/inet/IPv4RIBSupport.java
bgp/inet/src/main/java/org/opendaylight/protocol/bgp/inet/IPv6RIBSupport.java
bgp/inet/src/main/java/org/opendaylight/protocol/bgp/inet/codec/Ipv4NlriParser.java
bgp/inet/src/main/java/org/opendaylight/protocol/bgp/inet/codec/Ipv6NlriParser.java
bgp/inet/src/test/java/org/opendaylight/protocol/bgp/inet/IPv4RIBSupportTest.java
bgp/inet/src/test/java/org/opendaylight/protocol/bgp/inet/IPv6RIBSupportTest.java
bgp/inet/src/test/java/org/opendaylight/protocol/bgp/inet/codec/BGPParserTest.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/unicast/AbstractVpnNlriParser.java
bgp/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/unicast/AbstractVpnRIBSupport.java
bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/unicast/ipv4/VpnIpv4RIBSupportTest.java
bgp/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/unicast/ipv6/VpnIpv6RIBSupportTest.java
bgp/labeled-unicast/src/main/java/org/opendaylight/protocol/bgp/labeled/unicast/AbstractLabeledUnicastRIBSupport.java
bgp/labeled-unicast/src/main/java/org/opendaylight/protocol/bgp/labeled/unicast/LUNlriParser.java
bgp/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv4RIBSupportTest.java
bgp/labeled-unicast/src/test/java/org/opendaylight/protocol/bgp/labeled/unicast/LabeledUnicastIpv6RIBSupportTest.java
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/LinkstateRIBSupport.java
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/attribute/LinkstateAttributeParser.java
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/nlri/LinkstateNlriParser.java
bgp/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateAttributeParserTest.java
bgp/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateRIBSupportTest.java
bgp/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/ParserTest.java
bgp/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/AbstractMvpnRIBSupport.java
bgp/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/PEDistinguisherLabelsAttributeHandler.java
bgp/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/PMSITunnelAttributeHandler.java
bgp/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/nlri/MvpnIpv4NlriHandler.java
bgp/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/nlri/MvpnIpv6NlriHandler.java
bgp/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/MvpnIpv4RIBSupportTest.java
bgp/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/MvpnIpv6RIBSupportTest.java
bgp/openconfig-rp-spi/src/main/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/spi/registry/ActionsRegistryImpl.java
bgp/openconfig-rp-spi/src/main/java/org/opendaylight/protocol/bgp/openconfig/routing/policy/spi/registry/BgpConditionsRegistry.java
bgp/openconfig-state/src/test/java/org/opendaylight/protocol/bgp/state/StateProviderImplTest.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/open/AddPathCapabilityHandler.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/open/GracefulCapabilityHandler.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/open/MultiProtocolCapabilityHandler.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/open/RouteRefreshCapabilityHandler.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/update/MPReachAttributeParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/update/MPUnreachAttributeParser.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/BGPParserTest.java
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/OpenTest.java
bgp/parser-mock/src/test/java/org/opendaylight/protocol/bgp/parser/mock/BGPMessageParserMockTest.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/MessageUtil.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/pojo/SimpleAttributeRegistry.java
bgp/parser-spi/src/test/java/org/opendaylight/protocol/bgp/parser/spi/pojo/UnrecognizedAttributesTest.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSessionImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSynchronization.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/EffectiveRibInWriter.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/config/AppPeer.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/config/BGPClusterSingletonService.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/config/BgpPeer.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/config/OpenConfigMappingUtil.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/state/BGPSessionStateImpl.java
bgp/rib-mock/src/main/java/org/opendaylight/protocol/bgp/rib/mock/EventBusRegistration.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/AbstractRIBSupport.java
bgp/rib-spi/src/test/java/org/opendaylight/protocol/bgp/rib/spi/AbstractRIBSupportTest.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/AbstractReachabilityTopologyBuilder.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/AbstractTopologyBuilder.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/LinkstateTopologyBuilder.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/ProtocolUtil.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/config/AbstractBgpTopologyProvider.java
bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/Ipv4ReachabilityTopologyBuilderTest.java
bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/Ipv6ReachabilityTopologyBuilderTest.java
bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/LinkstateTopologyBuilderTest.java
bmp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/app/BmpRibInWriter.java
bmp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/app/BmpRouterPeerImpl.java
config-loader/bmp-monitors-config-loader/src/main/java/org/opendaylight/bgpcep/config/loader/bmp/BmpMonitorConfigFileProcessor.java
config-loader/protocols-config-loader/src/main/java/org/opendaylight/bgpcep/config/loader/protocols/ProtocolsConfigFileProcessor.java
config-loader/topology-config-loader/src/main/java/org/opendaylight/bgpcep/config/loader/topology/NetworkTopologyConfigFileProcessor.java
pcep/auto-bandwidth-extension/src/main/java/org/opendaylight/protocol/pcep/auto/bandwidth/extension/PcRptMessageCodec.java
pcep/auto-bandwidth-extension/src/test/java/org/opendaylight/protocol/pcep/auto/bandwidth/extension/PcRptMessageCodecTest.java
pcep/ietf-stateful07/src/main/java/org/opendaylight/protocol/pcep/ietf/initiated00/CInitiated00LspObjectParser.java
pcep/ietf-stateful07/src/main/java/org/opendaylight/protocol/pcep/ietf/initiated00/CInitiated00SrpObjectParser.java
pcep/ietf-stateful07/src/main/java/org/opendaylight/protocol/pcep/ietf/initiated00/CInitiated00StatefulCapabilityTlvParser.java
pcep/ietf-stateful07/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful07/Stateful07LspaObjectParser.java
pcep/ietf-stateful07/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful07/Stateful07OpenObjectParser.java
pcep/ietf-stateful07/src/main/java/org/opendaylight/protocol/pcep/sync/optimizations/SyncOptimizationsCapabilityTlvParser.java
pcep/ietf-stateful07/src/main/java/org/opendaylight/protocol/pcep/sync/optimizations/SyncOptimizationsLspObjectParser.java
pcep/ietf-stateful07/src/main/java/org/opendaylight/protocol/pcep/sync/optimizations/SyncOptimizationsOpenObjectParser.java
pcep/ietf-stateful07/src/test/java/org/opendaylight/protocol/pcep/ietf/PCEPObjectParserTest.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCSyncOptimization.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTunnelManagerImpl.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCMockCommon.java
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/PcepOpenObjectWithSpcTlvParser.java
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/TopologyProviderTest.java
pcep/topology/cli/src/main/java/org/opendaylight/protocol/pcep/cli/utils/PcepStateUtils.java
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/AbstractTopologySessionListener.java
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/PCEPStatefulPeerProposal.java
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/ServerSessionManager.java
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/Stateful07TopologySessionListener.java
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/SyncOptimization.java
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/TopologyNodeState.java
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/config/PCEPTopologyDeployerImpl.java
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/config/PCEPTopologyProviderUtil.java
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/session/stats/SessionStateImpl.java
pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/PCEPStatefulPeerProposalTest.java
pcep/topology/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/Stateful07TopologySessionListenerTest.java
pcep/tunnel/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/CreateTunnelInstructionExecutor.java
pcep/tunnel/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/DestroyTunnelInstructionExecutor.java
pcep/tunnel/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/NodeChangedListener.java
pcep/tunnel/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/TunelProgrammingUtil.java
pcep/tunnel/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/TunnelProviderDeployer.java
pcep/tunnel/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/UpdateTunnelInstructionExecutor.java
pcep/tunnel/tunnel-provider/src/test/java/org/opendaylight/bgpcep/pcep/tunnel/provider/NodeChangedListenerTest.java
pcep/tunnel/tunnel-provider/src/test/java/org/opendaylight/bgpcep/pcep/tunnel/provider/TunnelProgrammingTest.java
programming/impl/src/main/java/org/opendaylight/bgpcep/programming/impl/ProgrammingServiceImpl.java
testtool-util/src/test/java/org/opendaylight/protocol/util/CheckUtilTest.java

index 04b1f5e752c74974d428c00d6cecdf84dca1814d..fc729fd6fe113432068bc9e3ae5fbfc1f551db17 100644 (file)
@@ -217,7 +217,7 @@ public class AppPeerBenchmark implements OdlBgpAppPeerBenchmarkService, Transact
                 final Ipv4RouteBuilder ipv4RouteBuilder = new Ipv4RouteBuilder();
                 ipv4RouteBuilder.setRouteKey(routeKey.getRouteKey());
                 ipv4RouteBuilder.setPrefix(new Ipv4Prefix(routeKey.getRouteKey()));
-                ipv4RouteBuilder.setKey(routeKey);
+                ipv4RouteBuilder.withKey(routeKey);
                 ipv4RouteBuilder.setAttributes(attributes);
                 final Ipv4Route ipv4Route = ipv4RouteBuilder.build();
                 wt.put(LogicalDatastoreType.CONFIGURATION, routeIId,
index c114d97b3baf1e97e236013dd9cdc4158799de0a..d5c7e587abc51b13f17d0235b730929073310151 100644 (file)
@@ -72,7 +72,7 @@ public final class BGPOperationalStateUtils {
         } else {
             if (neighbor != null) {
                 globalBgp.getNeighbors().getNeighbor().stream()
-                        .filter(neig -> Ipv4Util.toStringIP(neig.getKey().getNeighborAddress()).matches(neighbor))
+                        .filter(neig -> Ipv4Util.toStringIP(neig.key().getNeighborAddress()).matches(neighbor))
                         .findFirst()
                         .ifPresent(neighbor1 -> displayNeighborOperationalState(neighbor, neighbor1, stream));
             } else {
index 64917e85826ca8b434211d2c32fe91d4906cd2be..52aba68d46725089fc57715c6806591653ac4810 100644 (file)
@@ -44,7 +44,7 @@ final class GlobalStateCliUtils {
 
     private static void displayAfiSafi(final AfiSafi afiSafi, final ShellTable table) {
         final GlobalAfiSafiStateAugmentation state = afiSafi.getState()
-                .getAugmentation(GlobalAfiSafiStateAugmentation.class);
+                .augmentation(GlobalAfiSafiStateAugmentation.class);
         addHeader(table, "AFI/SAFI state");
         table.addRow().addContent("Family", afiSafi.getAfiSafiName().getSimpleName());
         if (state == null) {
index bbec1ace525c64b5881fd549af61a552e2c03781..fb978cc54d2d6b140c31dc6d879c58010f193439 100644 (file)
@@ -47,7 +47,7 @@ final class NeighborStateCliUtils {
         table.column("Value").alignLeft();
         table.addRow().addContent("Neighbor Address", neighborId);
 
-        final NeighborStateAugmentation stateAug = neighborState.getAugmentation(NeighborStateAugmentation.class);
+        final NeighborStateAugmentation stateAug = neighborState.augmentation(NeighborStateAugmentation.class);
         if (stateAug != null) {
             table.addRow().addContent("Session State", stateAug.getSessionState());
             printCapabilitiesState(stateAug.getSupportedCapabilities(), table);
@@ -83,7 +83,7 @@ final class NeighborStateCliUtils {
 
     private static void printAfiSafiState(final AfiSafi afiSafi, final ShellTable table) {
         final NeighborAfiSafiStateAugmentation state = afiSafi.getState()
-                .getAugmentation(NeighborAfiSafiStateAugmentation.class);
+                .augmentation(NeighborAfiSafiStateAugmentation.class);
         addHeader(table, "AFI state");
         table.addRow().addContent("Family", afiSafi.getAfiSafiName().getSimpleName());
         table.addRow().addContent("Active", state.isActive());
@@ -99,7 +99,7 @@ final class NeighborStateCliUtils {
     }
 
     private static void printMessagesState(final State neighborState, final ShellTable table) {
-        final BgpNeighborStateAugmentation state = neighborState.getAugmentation(BgpNeighborStateAugmentation.class);
+        final BgpNeighborStateAugmentation state = neighborState.augmentation(BgpNeighborStateAugmentation.class);
         if (state == null) {
             return;
         }
@@ -122,7 +122,7 @@ final class NeighborStateCliUtils {
             return;
         }
         final NeighborTransportStateAugmentation state = transport.getState()
-                .getAugmentation(NeighborTransportStateAugmentation.class);
+                .augmentation(NeighborTransportStateAugmentation.class);
         if (state == null) {
             return;
         }
@@ -146,7 +146,7 @@ final class NeighborStateCliUtils {
         }
 
         final NeighborTimersStateAugmentation state = timers.getState()
-                .getAugmentation(NeighborTimersStateAugmentation.class);
+                .augmentation(NeighborTimersStateAugmentation.class);
         if (state == null) {
             return;
         }
index 10ea4b6cf5fcfd5625e94fdfb3110628513584c3..e5bc5970590e7d01e8a8ab6827dc873a473d96cd 100644 (file)
@@ -40,7 +40,7 @@ final class PeerGroupStateCliUtils {
         if (state == null) {
             return;
         }
-        final PeerGroupStateAugmentation aug = state.getAugmentation(PeerGroupStateAugmentation.class);
+        final PeerGroupStateAugmentation aug = state.augmentation(PeerGroupStateAugmentation.class);
         table.addRow().addContent("Total Prefixes", aug.getTotalPrefixes());
     }
 }
index 6ed881dc7f9e5fb3d97bba4e950f6e659abcbb68..2a27f33197f8ab67955d08f8b3a272ac945f45af 100644 (file)
@@ -134,7 +134,7 @@ final class EvpnRibSupport extends AbstractRIBSupport<EvpnRoutesCase, EvpnRoutes
         } else {
             builder = new EvpnRouteBuilder();
         }
-        return builder.setKey(createRouteListKey(pathId, routeKey)).setAttributes(attributes).build();
+        return builder.withKey(createRouteListKey(pathId, routeKey)).setAttributes(attributes).build();
     }
 
     @Override
index 5a65692225f3cdd886ee9c6e9807457d80cb4d74..e627ba32b2c4cb6daf10086b5be7931341401a36 100644 (file)
@@ -145,8 +145,8 @@ public final class EvpnNlriParser implements NlriParser, NlriSerializer {
     public void serializeAttribute(final DataObject attribute, final ByteBuf byteAggregator) {
         Preconditions.checkArgument(attribute instanceof Attributes, "Attribute parameter is not a Attributes object");
         final Attributes pathAttributes = (Attributes) attribute;
-        final Attributes1 pathAttributes1 = pathAttributes.getAugmentation(Attributes1.class);
-        final Attributes2 pathAttributes2 = pathAttributes.getAugmentation(Attributes2.class);
+        final Attributes1 pathAttributes1 = pathAttributes.augmentation(Attributes1.class);
+        final Attributes2 pathAttributes2 = pathAttributes.augmentation(Attributes2.class);
         if (pathAttributes1 != null) {
             final AdvertizedRoutes routes = pathAttributes1.getMpReachNlri().getAdvertizedRoutes();
             if (routes != null && routes.getDestinationType() instanceof DestinationEvpnCase) {
index d8f3994c3b0e931ecf0c111fc9ce4f594f5adf0a..0311463bec073d852d640ec5e3f7a74c0067bb8b 100644 (file)
@@ -125,18 +125,18 @@ public final class EvpnRibSupportTest extends AbstractRIBSupportTest<EvpnRoutesC
     public void testBuildMpUnreachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(),
                 createRoutes(EVPN_ROUTES), ATTRIBUTES);
-        assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri()
+        assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class).getMpUnreachNlri()
                 .getWithdrawnRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes1.class));
+        assertNull(update.getAttributes().augmentation(Attributes1.class));
     }
 
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(
                 createRoutes(EVPN_ROUTES), Collections.emptyList(), ATTRIBUTES);
-        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri()
+        assertEquals(REACH_NLRI, update.getAttributes().augmentation(Attributes1.class).getMpReachNlri()
                 .getAdvertizedRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes2.class));
+        assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
 
     @Test
@@ -199,4 +199,4 @@ public final class EvpnRibSupportTest extends AbstractRIBSupportTest<EvpnRoutesC
         final Collection<DataTreeCandidateNode> result = this.ribSupport.changedRoutes(tree);
         Assert.assertFalse(result.isEmpty());
     }
-}
\ No newline at end of file
+}
index e3f84b7a50d3a12ceaa69e72526cb43e0e12a461..eacd40e3c62b709b614e09f300183662bb2bffdd 100644 (file)
@@ -191,8 +191,8 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri
         Preconditions.checkArgument(attribute instanceof Attributes,
                 "Attribute parameter is not a PathAttribute object.");
         final Attributes pathAttributes = (Attributes) attribute;
-        final Attributes1 pathAttributes1 = pathAttributes.getAugmentation(Attributes1.class);
-        final Attributes2 pathAttributes2 = pathAttributes.getAugmentation(Attributes2.class);
+        final Attributes1 pathAttributes1 = pathAttributes.augmentation(Attributes1.class);
+        final Attributes2 pathAttributes2 = pathAttributes.augmentation(Attributes2.class);
 
         if (pathAttributes1 != null) {
             final AdvertizedRoutes routes = pathAttributes1.getMpReachNlri().getAdvertizedRoutes();
index 6715b97e1c940a9e6a7629966f93fabe270ffdd9..71db35ed546f6a9634340a93c224f6601eb68efa 100644 (file)
@@ -54,10 +54,11 @@ public final class FlowspecIpv4RIBSupport
     static synchronized FlowspecIpv4RIBSupport getInstance(
             SimpleFlowspecExtensionProviderContext context,
             final BindingNormalizedNodeSerializer mappingService) {
-        if(SINGLETON == null){
+        if (SINGLETON == null){
             SINGLETON = new FlowspecIpv4RIBSupport(context, mappingService);
         }
-        return SINGLETON;    }
+        return SINGLETON;
+    }
 
     @Override
     public FlowspecRoute createRoute(final FlowspecRoute route, final String routeKey, final long pathId,
@@ -68,7 +69,7 @@ public final class FlowspecIpv4RIBSupport
         } else {
             builder = new FlowspecRouteBuilder();
         }
-        return builder.setKey(new FlowspecRouteKey(new PathId(pathId), routeKey)).setAttributes(attributes).build();
+        return builder.withKey(new FlowspecRouteKey(new PathId(pathId), routeKey)).setAttributes(attributes).build();
     }
 
     @Override
index 97059a3f6b897afa4ce4c0b2a8d93516278b666e..d0471b590749e3418f2b080f562f0d9e64702b82 100644 (file)
@@ -54,7 +54,7 @@ public final class FlowspecIpv6RIBSupport
     static synchronized FlowspecIpv6RIBSupport getInstance(
             SimpleFlowspecExtensionProviderContext context,
             final BindingNormalizedNodeSerializer mappingService) {
-        if(SINGLETON == null){
+        if (SINGLETON == null) {
             SINGLETON = new FlowspecIpv6RIBSupport(context, mappingService);
         }
         return SINGLETON;
@@ -69,7 +69,7 @@ public final class FlowspecIpv6RIBSupport
         } else {
             builder = new FlowspecRouteBuilder();
         }
-        return builder.setKey(new FlowspecRouteKey(new PathId(pathId), routeKey)).setAttributes(attributes).build();
+        return builder.withKey(new FlowspecRouteKey(new PathId(pathId), routeKey)).setAttributes(attributes).build();
     }
 
     @Override
index 2a3e80395d1f884d0c8692d750c0f230e3a73086..3e5b762b0ca74e9c3495f5748ec8ed35b59b4471 100644 (file)
@@ -74,7 +74,7 @@ public final class FlowspecL3vpnIpv4RIBSupport
         } else {
             builder = new FlowspecL3vpnRouteBuilder();
         }
-        return builder.setKey(new FlowspecL3vpnRouteKey(new PathId(pathId), routeKey))
+        return builder.withKey(new FlowspecL3vpnRouteKey(new PathId(pathId), routeKey))
                 .setAttributes(attributes).build();
     }
 
index 893c64f6ae342df343d2427e72a4a7c7710c2c90..8232685f08855c367714ba1573d60ad00e2a73d5 100644 (file)
@@ -74,7 +74,7 @@ public final class FlowspecL3vpnIpv6RIBSupport
         } else {
             builder = new FlowspecL3vpnRouteBuilder();
         }
-        return builder.setKey(new FlowspecL3vpnRouteKey(new PathId(pathId), routeKey))
+        return builder.withKey(new FlowspecL3vpnRouteKey(new PathId(pathId), routeKey))
                 .setAttributes(attributes).build();
     }
 
index 9bb82046667b069de8f1d6d19d2f337f005404b0..2d3fc7cf3c0eb4ee0241f8d2fdb12e6f80470718 100644 (file)
@@ -88,7 +88,7 @@ public class FlowspecIpv4RIBSupportTest extends AbstractRIBSupportTest<FlowspecR
                         SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC));
 
         this.routeKey = new FlowspecRouteKey(PATH_ID, parser.stringNlri(FLOW_LIST));
-        this.route = new FlowspecRouteBuilder().setKey(this.routeKey).setPathId(PATH_ID).setFlowspec(FLOW_LIST)
+        this.route = new FlowspecRouteBuilder().withKey(this.routeKey).setPathId(PATH_ID).setFlowspec(FLOW_LIST)
                 .setAttributes(new AttributesBuilder().build()).build();
         this.routes = new FlowspecRoutesBuilder().setFlowspecRoute(Collections.singletonList(this.route)).build();
         setUpTestCustomizer(this.ribSupport);
@@ -119,17 +119,17 @@ public class FlowspecIpv4RIBSupportTest extends AbstractRIBSupportTest<FlowspecR
     @Test
     public void testBuildMpUnreachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(), createRoutes(routes), ATTRIBUTES);
-        assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class)
+        assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class)
             .getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes1.class));
+        assertNull(update.getAttributes().augmentation(Attributes1.class));
     }
 
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(createRoutes(routes), Collections.emptyList(), ATTRIBUTES);
-        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri()
+        assertEquals(REACH_NLRI, update.getAttributes().augmentation(Attributes1.class).getMpReachNlri()
                 .getAdvertizedRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes2.class));
+        assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
 
     @Test
@@ -195,4 +195,4 @@ public class FlowspecIpv4RIBSupportTest extends AbstractRIBSupportTest<FlowspecR
         final Collection<DataTreeCandidateNode> result = this.ribSupport.changedRoutes(tree);
         Assert.assertFalse(result.isEmpty());
     }
-}
\ No newline at end of file
+}
index 8c997f1bd371bf00c037b250bffbf91f45906d2f..db311fa26a44e8cc5278e4f5c4d6c63187cc20a0 100644 (file)
@@ -85,7 +85,7 @@ public class FlowspecIpv6RIBSupportTest extends AbstractRIBSupportTest<FlowspecI
                 fsContext.getFlowspecTypeRegistry(SimpleFlowspecExtensionProviderContext.AFI.IPV4,
                         SimpleFlowspecExtensionProviderContext.SAFI.FLOWSPEC));
         this.routeKey = new FlowspecRouteKey(PATH_ID, parser.stringNlri(FLOW_LIST));
-        this.route = new FlowspecRouteBuilder().setKey(this.routeKey).setPathId(PATH_ID).setFlowspec(FLOW_LIST)
+        this.route = new FlowspecRouteBuilder().withKey(this.routeKey).setPathId(PATH_ID).setFlowspec(FLOW_LIST)
                 .setAttributes(new AttributesBuilder().build()).build();
         this.routes = new FlowspecIpv6RoutesBuilder().setFlowspecRoute(Collections.singletonList(this.route)).build();
         this.ribSupport = FlowspecIpv6RIBSupport.getInstance(fsContext, this.mappingService);
@@ -118,18 +118,18 @@ public class FlowspecIpv6RIBSupportTest extends AbstractRIBSupportTest<FlowspecI
     public void testBuildMpUnreachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(),
                 createRoutes(this.routes), ATTRIBUTES);
-        assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class)
+        assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class)
             .getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes1.class));
+        assertNull(update.getAttributes().augmentation(Attributes1.class));
     }
 
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(createRoutes(this.routes),
                 Collections.emptyList(), ATTRIBUTES);
-        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri()
+        assertEquals(REACH_NLRI, update.getAttributes().augmentation(Attributes1.class).getMpReachNlri()
                 .getAdvertizedRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes2.class));
+        assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
 
     @Test
@@ -196,4 +196,4 @@ public class FlowspecIpv6RIBSupportTest extends AbstractRIBSupportTest<FlowspecI
         final Collection<DataTreeCandidateNode> result = this.ribSupport.changedRoutes(tree);
         Assert.assertFalse(result.isEmpty());
     }
-}
\ No newline at end of file
+}
index a818f4ba6e2049560a3b5f0309857baafc2e1c23..ea104803fd0dd71cf429333486c9cbb3b4ae7cb9 100644 (file)
@@ -77,7 +77,7 @@ public class FlowspecL3vpnIpv4RIBSupportTest extends AbstractRIBSupportTest<Flow
     static {
         ROUTE_KEY = new FlowspecL3vpnRouteKey(PATH_ID,
                 "[l3vpn with route-distinguisher 0:5:3] all packets to 172.17.1.0/24");
-        ROUTE = new FlowspecL3vpnRouteBuilder().setKey(ROUTE_KEY).setPathId(PATH_ID).setFlowspec(FLOW_LIST)
+        ROUTE = new FlowspecL3vpnRouteBuilder().withKey(ROUTE_KEY).setPathId(PATH_ID).setFlowspec(FLOW_LIST)
             .setAttributes(new AttributesBuilder().build()).setRouteDistinguisher(RD).build();
     }
 
@@ -115,18 +115,18 @@ public class FlowspecL3vpnIpv4RIBSupportTest extends AbstractRIBSupportTest<Flow
     public void testBuildMpUnreachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(), createRoutes(
             new FlowspecL3vpnIpv4RoutesBuilder().setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build()), ATTRIBUTES);
-        assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class)
+        assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class)
             .getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes1.class));
+        assertNull(update.getAttributes().augmentation(Attributes1.class));
     }
 
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(createRoutes(
             new FlowspecL3vpnIpv4RoutesBuilder().setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build()), Collections.emptyList(), ATTRIBUTES);
-        final AdvertizedRoutes advertised = update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri().getAdvertizedRoutes();
+        final AdvertizedRoutes advertised = update.getAttributes().augmentation(Attributes1.class).getMpReachNlri().getAdvertizedRoutes();
         assertEquals(REACH_NLRI, advertised.getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes2.class));
+        assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
 
     @Test
index 590f6dcda92bc49bcda25054418b63c958428f4f..b7c9079ea7f5dbc953c282355c95b9fa429b5d07 100644 (file)
@@ -75,7 +75,7 @@ public class FlowspecL3vpnIpv6RIBSupportTest extends AbstractRIBSupportTest<Flow
     static {
         ROUTE_KEY = new FlowspecL3vpnRouteKey(PATH_ID,
                 "[l3vpn with route-distinguisher 0:5:3] all packets to 2001:db8:1:2::/64");
-        ROUTE = new FlowspecL3vpnRouteBuilder().setKey(ROUTE_KEY).setPathId(PATH_ID).setFlowspec(FLOW_LIST)
+        ROUTE = new FlowspecL3vpnRouteBuilder().withKey(ROUTE_KEY).setPathId(PATH_ID).setFlowspec(FLOW_LIST)
                 .setAttributes(new AttributesBuilder().build()).setRouteDistinguisher(RD).build();
     }
 
@@ -116,9 +116,9 @@ public class FlowspecL3vpnIpv6RIBSupportTest extends AbstractRIBSupportTest<Flow
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(), createRoutes(
             new FlowspecL3vpnIpv6RoutesBuilder()
                     .setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build()), ATTRIBUTES);
-        assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class)
+        assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class)
             .getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes1.class));
+        assertNull(update.getAttributes().augmentation(Attributes1.class));
     }
 
     @Test
@@ -127,9 +127,9 @@ public class FlowspecL3vpnIpv6RIBSupportTest extends AbstractRIBSupportTest<Flow
             new FlowspecL3vpnIpv6RoutesBuilder().setFlowspecL3vpnRoute(Collections.singletonList(ROUTE)).build()),
                 Collections.emptyList(), ATTRIBUTES);
         final AdvertizedRoutes advertised
-                = update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri().getAdvertizedRoutes();
+                = update.getAttributes().augmentation(Attributes1.class).getMpReachNlri().getAdvertizedRoutes();
         assertEquals(REACH_NLRI, advertised.getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes2.class));
+        assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
 
     @Test
@@ -198,4 +198,4 @@ public class FlowspecL3vpnIpv6RIBSupportTest extends AbstractRIBSupportTest<Flow
         final Collection<DataTreeCandidateNode> result = this.ribSupport.changedRoutes(tree);
         Assert.assertFalse(result.isEmpty());
     }
-}
\ No newline at end of file
+}
index d350c864a9e931a5cf78884d3ae67b3371e1a12b..7db4eec453acda8c03145abdd782aa1364d4983d 100644 (file)
@@ -97,7 +97,7 @@ final class IPv4RIBSupport extends AbstractIPRibSupport<Ipv4RoutesCase, Ipv4Rout
         } else {
             builder = new Ipv4RouteBuilder();
         }
-        builder.setKey(createRouteListKey(pathId, routeKey)).setAttributes(attributes);
+        builder.withKey(createRouteListKey(pathId, routeKey)).setAttributes(attributes);
         return builder.build();
     }
 
index 15559f05e44a430707aca50ba3a80f40fee2eb56..94a45427c885eb4288f036515b0b11776dcf0361 100644 (file)
@@ -94,7 +94,7 @@ final class IPv6RIBSupport extends AbstractIPRibSupport<Ipv6RoutesCase, Ipv6Rout
         } else {
             builder = new Ipv6RouteBuilder();
         }
-        return builder.setKey(new Ipv6RouteKey(new PathId(pathId), routeKey)).setAttributes(attributes).build();
+        return builder.withKey(new Ipv6RouteKey(new PathId(pathId), routeKey)).setAttributes(attributes).build();
     }
 
     @Override
index b317937e31e3135cd3d24e74509e2c65ebca8e7c..ed8fe0602971729cbe03f12e927a0ad2862cd614 100644 (file)
@@ -78,8 +78,8 @@ public final class Ipv4NlriParser implements NlriParser, NlriSerializer {
         Preconditions.checkArgument(attribute instanceof Attributes,
                 "Attribute parameter is not a PathAttribute object.");
         final Attributes pathAttributes = (Attributes) attribute;
-        final Attributes1 pathAttributes1 = pathAttributes.getAugmentation(Attributes1.class);
-        final Attributes2 pathAttributes2 = pathAttributes.getAugmentation(Attributes2.class);
+        final Attributes1 pathAttributes1 = pathAttributes.augmentation(Attributes1.class);
+        final Attributes2 pathAttributes2 = pathAttributes.augmentation(Attributes2.class);
         if (pathAttributes1 != null) {
             final AdvertizedRoutes advertizedRoutes = pathAttributes1.getMpReachNlri().getAdvertizedRoutes();
             if (advertizedRoutes != null && advertizedRoutes.getDestinationType() instanceof DestinationIpv4Case) {
index e8ca321ecc3293d7eec853dae9c1a45d0e060e77..aad2127269447da73fcd49022c7716755d4cafe4 100644 (file)
@@ -78,8 +78,8 @@ public final class Ipv6NlriParser implements NlriParser, NlriSerializer {
         Preconditions.checkArgument(attribute instanceof Attributes,
                 "Attribute parameter is not a PathAttribute object.");
         final Attributes pathAttributes = (Attributes) attribute;
-        final Attributes1 pathAttributes1 = pathAttributes.getAugmentation(Attributes1.class);
-        final Attributes2 pathAttributes2 = pathAttributes.getAugmentation(Attributes2.class);
+        final Attributes1 pathAttributes1 = pathAttributes.augmentation(Attributes1.class);
+        final Attributes2 pathAttributes2 = pathAttributes.augmentation(Attributes2.class);
         if (pathAttributes1 != null) {
             final AdvertizedRoutes advertizedRoutes = pathAttributes1.getMpReachNlri().getAdvertizedRoutes();
             if (advertizedRoutes != null && advertizedRoutes.getDestinationType() instanceof DestinationIpv6Case) {
index 34ed098a730ab546c8d43b3d4fb209d674b7a15c..9ef4c8404aee99f16077607b2b748d650a7cf149 100644 (file)
@@ -107,17 +107,17 @@ public final class IPv4RIBSupportTest extends AbstractRIBSupportTest<Ipv4RoutesC
     @Test
     public void testBuildMpUnreachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(), createRoutes(ROUTES), ATTRIBUTES);
-        assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri()
+        assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class).getMpUnreachNlri()
                 .getWithdrawnRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes1.class));
+        assertNull(update.getAttributes().augmentation(Attributes1.class));
     }
 
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(createRoutes(ROUTES), Collections.emptyList(), ATTRIBUTES);
-        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri()
+        assertEquals(REACH_NLRI, update.getAttributes().augmentation(Attributes1.class).getMpReachNlri()
                 .getAdvertizedRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes2.class));
+        assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
 
     @Test
index aa7b0a555221afb2473961e21d97a38feb35d00d..088c817827aeda9f5e91c78a3efcadc78278dd13 100644 (file)
@@ -107,17 +107,17 @@ public final class IPv6RIBSupportTest extends AbstractRIBSupportTest<Ipv6RoutesC
     @Test
     public void testBuildMpUnreachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(), createRoutes(ROUTES), ATTRIBUTES);
-        assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class)
+        assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class)
                 .getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes1.class));
+        assertNull(update.getAttributes().augmentation(Attributes1.class));
     }
 
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(createRoutes(ROUTES), Collections.emptyList(), ATTRIBUTES);
-        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class)
+        assertEquals(REACH_NLRI, update.getAttributes().augmentation(Attributes1.class)
                 .getMpReachNlri().getAdvertizedRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes2.class));
+        assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
 
     @Test
index 895fe0d1298e6cc09e5f8f035b3f6968ddf0039f..f4a8a2875a01939bf930e706971098905fd44b26 100644 (file)
@@ -200,8 +200,8 @@ public class BGPParserTest {
 
         paBuilder.addAugmentation(Attributes1.class, new Attributes1Builder()
                 .setMpReachNlri(mpBuilder.build()).build());
-        assertEquals(paBuilder.getAugmentation(Attributes1.class).getMpReachNlri(),
-                attrs.getAugmentation(Attributes1.class).getMpReachNlri());
+        assertEquals(paBuilder.augmentation(Attributes1.class).getMpReachNlri(),
+                attrs.augmentation(Attributes1.class).getMpReachNlri());
         paBuilder.setUnrecognizedAttributes(Collections.emptyList());
         // check API message
 
index ce24e94a48a431aea051067d1e81c3b6a3e61261..ed46786fc3df988ea6f5252201c8ff7bfe15981b 100644 (file)
@@ -82,8 +82,8 @@ public abstract class AbstractVpnNlriParser implements NlriParser, NlriSerialize
         Preconditions.checkArgument(attribute instanceof Attributes,
                 "Attribute parameter is not a Attributes object");
         final Attributes pathAttributes = (Attributes) attribute;
-        final Attributes1 pathAttributes1 = pathAttributes.getAugmentation(Attributes1.class);
-        final Attributes2 pathAttributes2 = pathAttributes.getAugmentation(Attributes2.class);
+        final Attributes1 pathAttributes1 = pathAttributes.augmentation(Attributes1.class);
+        final Attributes2 pathAttributes2 = pathAttributes.augmentation(Attributes2.class);
         List<VpnDestination> vpnDst = null;
         boolean isWithdrawnRoute = false;
         if (pathAttributes1 != null) {
index b1b06bd42852d69e8bcd306f0ec492d296f0e7dc..08da8b7640583cba26c830ef96a707333a47fa41 100644 (file)
@@ -171,7 +171,7 @@ public abstract class AbstractVpnRIBSupport<C extends Routes & DataObject, S ext
         } else {
             builder = new VpnRouteBuilder();
         }
-        return builder.setKey(new VpnRouteKey(new PathId(pathId), vpnRouteKey)).setAttributes(attributes).build();
+        return builder.withKey(new VpnRouteKey(new PathId(pathId), vpnRouteKey)).setAttributes(attributes).build();
     }
 
     @Override
index 0c42d6b82d83a867ae9f030603c4df7942867ddb..87083ca65437d9715b303559e62ec7d331863086 100644 (file)
@@ -64,7 +64,7 @@ public class VpnIpv4RIBSupportTest extends AbstractRIBSupportTest<VpnIpv4RoutesC
 
     private static final VpnRoute ROUTE = new VpnRouteBuilder().setPathId(NON_PATH_ID)
             .setAttributes(ATTRIBUTES).setPrefix(IPV4_PREFIX)
-        .setLabelStack(LABEL_STACK).setRouteDistinguisher(DISTINGUISHER).setKey(ROUTE_KEY).build();
+        .setLabelStack(LABEL_STACK).setRouteDistinguisher(DISTINGUISHER).withKey(ROUTE_KEY).build();
     private static final VpnIpv4Routes ROUTES = new VpnIpv4RoutesBuilder()
             .setVpnRoute(Collections.singletonList(ROUTE)).build();
 
@@ -101,17 +101,17 @@ public class VpnIpv4RIBSupportTest extends AbstractRIBSupportTest<VpnIpv4RoutesC
     @Test
     public void testBuildMpUnreachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(), createRoutes(ROUTES), ATTRIBUTES);
-        assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class)
+        assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class)
             .getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes1.class));
+        assertNull(update.getAttributes().augmentation(Attributes1.class));
     }
 
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(createRoutes(ROUTES), Collections.emptyList(), ATTRIBUTES);
-        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri()
+        assertEquals(REACH_NLRI, update.getAttributes().augmentation(Attributes1.class).getMpReachNlri()
                 .getAdvertizedRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes2.class));
+        assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
 
     @Test
@@ -174,4 +174,4 @@ public class VpnIpv4RIBSupportTest extends AbstractRIBSupportTest<VpnIpv4RoutesC
         final Collection<DataTreeCandidateNode> result = this.ribSupport.changedRoutes(tree);
         Assert.assertFalse(result.isEmpty());
     }
-}
\ No newline at end of file
+}
index d49522411b2ce7050f5f6349ca4762350f3280ef..28e3ad114cd64bfd9aea16cf4f3d545383099026 100644 (file)
@@ -64,7 +64,7 @@ public class VpnIpv6RIBSupportTest extends AbstractRIBSupportTest<VpnIpv6RoutesC
     private static final VpnRouteKey ROUTE_KEY = new VpnRouteKey(new PathId(0L), "cAABAQIDBAECIAEjRVaJ");
     private static final VpnRoute ROUTE = new VpnRouteBuilder().setPathId(NON_PATH_ID)
             .setAttributes(ATTRIBUTES).setPrefix(IPV6PREFIX)
-            .setLabelStack(LABEL_STACK).setRouteDistinguisher(DISTINGUISHER).setKey(ROUTE_KEY).build();
+            .setLabelStack(LABEL_STACK).setRouteDistinguisher(DISTINGUISHER).withKey(ROUTE_KEY).build();
     private static final VpnIpv6Routes ROUTES = new VpnIpv6RoutesBuilder()
             .setVpnRoute(Collections.singletonList(ROUTE)).build();
 
@@ -100,17 +100,17 @@ public class VpnIpv6RIBSupportTest extends AbstractRIBSupportTest<VpnIpv6RoutesC
     @Test
     public void testBuildMpUnreachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(), createRoutes(ROUTES), ATTRIBUTES);
-        assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class)
+        assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class)
                 .getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes1.class));
+        assertNull(update.getAttributes().augmentation(Attributes1.class));
     }
 
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(createRoutes(ROUTES), Collections.emptyList(), ATTRIBUTES);
-        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri()
+        assertEquals(REACH_NLRI, update.getAttributes().augmentation(Attributes1.class).getMpReachNlri()
                 .getAdvertizedRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes2.class));
+        assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
 
     @Test
@@ -173,4 +173,4 @@ public class VpnIpv6RIBSupportTest extends AbstractRIBSupportTest<VpnIpv6RoutesC
         final Collection<DataTreeCandidateNode> result = this.ribSupport.changedRoutes(tree);
         Assert.assertFalse(result.isEmpty());
     }
-}
\ No newline at end of file
+}
index cbbe65558944c82fa904bedad34d04c455f73dd8..57be87a87758f2bea7adfc5971cb651e398f4b67 100644 (file)
@@ -176,7 +176,7 @@ abstract class AbstractLabeledUnicastRIBSupport<
         } else {
             builder = new LabeledUnicastRouteBuilder();
         }
-        return builder.setKey(new LabeledUnicastRouteKey(new PathId(pathId), routeKey))
+        return builder.withKey(new LabeledUnicastRouteKey(new PathId(pathId), routeKey))
                 .setAttributes(attributes).build();
     }
 }
index 59f546dbe68bca56f471b3efcc0ddda8f80047ce..febefe429237ff7b49173b526f22efff7ed0f6a8 100644 (file)
@@ -65,10 +65,10 @@ public class LUNlriParser implements NlriParser, NlriSerializer {
     public void serializeAttribute(final DataObject attribute, final ByteBuf byteAggregator) {
         Preconditions.checkArgument(attribute instanceof Attributes, "Attribute parameter is not a Attributes object");
         final Attributes pathAttributes = (Attributes) attribute;
-        final Attributes1 pathAttributes1 = pathAttributes.getAugmentation(Attributes1.class);
-        final Attributes2 pathAttributes2 = pathAttributes.getAugmentation(Attributes2.class);
+        final Attributes1 pathAttributes1 = pathAttributes.augmentation(Attributes1.class);
+        final Attributes2 pathAttributes2 = pathAttributes.augmentation(Attributes2.class);
         if (pathAttributes1 != null) {
-            final AdvertizedRoutes routes = (pathAttributes1.getMpReachNlri()).getAdvertizedRoutes();
+            final AdvertizedRoutes routes = pathAttributes1.getMpReachNlri().getAdvertizedRoutes();
             if (routes != null) {
                 final DestinationType destinationType = routes.getDestinationType();
                 if ( destinationType instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
@@ -110,7 +110,7 @@ public class LUNlriParser implements NlriParser, NlriSerializer {
             final IpPrefix prefix = dest.getPrefix();
             // Serialize the length field
             // Length field contains one Byte which represents the length of label stack and prefix in bits
-            nlriByteBuf.writeByte(((LABEL_LENGTH * (!isUnreachNlri ? labelStack.size() : 1)) + getPrefixLength(prefix)) * Byte.SIZE);
+            nlriByteBuf.writeByte((LABEL_LENGTH * (!isUnreachNlri ? labelStack.size() : 1) + getPrefixLength(prefix)) * Byte.SIZE);
 
             serializeLabelStackEntries(labelStack, isUnreachNlri, nlriByteBuf);
             serializePrefixField(prefix, nlriByteBuf);
@@ -173,7 +173,7 @@ public class LUNlriParser implements NlriParser, NlriSerializer {
             final List<LabelStack> labels = parseLabel(nlri);
             builder.setLabelStack(labels);
             final int labelNum = labels != null ? labels.size() : 1;
-            final int prefixLen = length - (LABEL_LENGTH * Byte.SIZE * labelNum);
+            final int prefixLen = length - LABEL_LENGTH * Byte.SIZE * labelNum;
             builder.setPrefix(parseIpPrefix(nlri, prefixLen, afi));
             dests.add(builder.build());
         }
@@ -181,7 +181,7 @@ public class LUNlriParser implements NlriParser, NlriSerializer {
     }
 
     public static IpPrefix parseIpPrefix(final ByteBuf nlri, final int prefixLen, final Class<? extends AddressFamily> afi) {
-        final int prefixLenInByte = (prefixLen / Byte.SIZE) + (((prefixLen % Byte.SIZE) == 0) ? 0 : 1);
+        final int prefixLenInByte = prefixLen / Byte.SIZE + (prefixLen % Byte.SIZE == 0 ? 0 : 1);
         if (afi.equals(Ipv4AddressFamily.class)) {
             return new IpPrefix(Ipv4Util.prefixForBytes(ByteArray.readBytes(nlri, prefixLenInByte), prefixLen));
         } else if (afi.equals(Ipv6AddressFamily.class)) {
index abfefa55dcf44652481d80d511f573782083ee2c..36b3800f3094abaed456c050710226b57ed8a8bb 100644 (file)
@@ -90,7 +90,7 @@ public class LabeledUnicastIpv4RIBSupportTest extends AbstractRIBSupportTest<Lab
         LABEL_KEY = ByteArray.encodeBase64(buffer);
         ROUTE_KEY = new LabeledUnicastRouteKey(PATH_ID, LABEL_KEY);
         ROUTE = new LabeledUnicastRouteBuilder()
-                .setKey(ROUTE_KEY)
+                .withKey(ROUTE_KEY)
                 .setPrefix(IPv4_PREFIX)
                 .setPathId(PATH_ID)
                 .setLabelStack(LABEL_STACK)
@@ -132,17 +132,17 @@ public class LabeledUnicastIpv4RIBSupportTest extends AbstractRIBSupportTest<Lab
     @Test
     public void testBuildMpUnreachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(), createRoutes(ROUTES), ATTRIBUTES);
-        assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class)
+        assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class)
             .getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes1.class));
+        assertNull(update.getAttributes().augmentation(Attributes1.class));
     }
 
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(createRoutes(ROUTES), Collections.emptyList(), ATTRIBUTES);
-        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri()
+        assertEquals(REACH_NLRI, update.getAttributes().augmentation(Attributes1.class).getMpReachNlri()
                 .getAdvertizedRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes2.class));
+        assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
 
     @Test
index 17a11bf9fcebddd71e88776c8a4271298a1c2266..3e7f11a92968c12382b2efb8101c9a631de2cfc6 100644 (file)
@@ -92,7 +92,7 @@ public class LabeledUnicastIpv6RIBSupportTest extends AbstractRIBSupportTest<Lab
         LUNlriParser.serializeNlri(LABELED_DESTINATION_LIST, false, buffer);
         LABEL_KEY = ByteArray.encodeBase64(buffer);
         ROUTE_KEY = new LabeledUnicastRouteKey(PATH_ID, LABEL_KEY);
-        ROUTE = new LabeledUnicastRouteBuilder().setKey(ROUTE_KEY)
+        ROUTE = new LabeledUnicastRouteBuilder().withKey(ROUTE_KEY)
                 .setPrefix(IPv6_PREFIX).setPathId(PATH_ID).setLabelStack(LABEL_STACK)
             .setAttributes(new AttributesBuilder().build()).build();
         ROUTES = new LabeledUnicastIpv6RoutesBuilder().setLabeledUnicastRoute(Collections.singletonList(ROUTE)).build();
@@ -130,17 +130,17 @@ public class LabeledUnicastIpv6RIBSupportTest extends AbstractRIBSupportTest<Lab
     @Test
     public void testBuildMpUnreachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(), createRoutes(ROUTES), ATTRIBUTES);
-        assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class)
+        assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class)
             .getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes1.class));
+        assertNull(update.getAttributes().augmentation(Attributes1.class));
     }
 
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(createRoutes(ROUTES), Collections.emptyList(), ATTRIBUTES);
-        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri()
+        assertEquals(REACH_NLRI, update.getAttributes().augmentation(Attributes1.class).getMpReachNlri()
                 .getAdvertizedRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes2.class));
+        assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
 
     @Test
index 09b3eceacfd3ac92a596e314f5c75d95b09e81cc..b35b8c2ced5ee2cc53e653d668a38584561855c0 100644 (file)
@@ -145,7 +145,7 @@ public final class LinkstateRIBSupport
         } else {
             builder = new LinkstateRouteBuilder();
         }
-        return builder.setKey(createRouteListKey(pathId, routeKey)).setAttributes(attributes).build();
+        return builder.withKey(createRouteListKey(pathId, routeKey)).setAttributes(attributes).build();
     }
 
     @Override
index 83ae9e7dd0b9a313fa6ab42bfe35042376de2217..8082b7e0e831ea352f86e9136c8cd5fb00148173 100644 (file)
@@ -94,7 +94,7 @@ public final class LinkstateAttributeParser implements AttributeParser, Attribut
     }
 
     private static CLinkstateDestination getNlriType(final AttributesBuilder pab) {
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.Attributes1 mpr = pab.getAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.Attributes1.class);
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.Attributes1 mpr = pab.augmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.Attributes1.class);
         if (mpr != null && mpr.getMpReachNlri() != null) {
             final DestinationType dt = mpr.getMpReachNlri().getAdvertizedRoutes().getDestinationType();
             if (dt instanceof DestinationLinkstateCase) {
@@ -103,7 +103,7 @@ public final class LinkstateAttributeParser implements AttributeParser, Attribut
                 }
             }
         }
-        final Attributes2 mpu = pab.getAugmentation(Attributes2.class);
+        final Attributes2 mpu = pab.augmentation(Attributes2.class);
         if (mpu != null && mpu.getMpUnreachNlri() != null) {
             final DestinationType dt = mpu.getMpUnreachNlri().getWithdrawnRoutes().getDestinationType();
             if (dt instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationLinkstateCase) {
@@ -142,7 +142,7 @@ public final class LinkstateAttributeParser implements AttributeParser, Attribut
     @Override
     public void serializeAttribute(final DataObject attribute, final ByteBuf byteAggregator) {
         Preconditions.checkArgument(attribute instanceof Attributes, "Attribute parameter is not a PathAttribute object.");
-        final Attributes1 pathAttributes1 = ((Attributes) attribute).getAugmentation(Attributes1.class);
+        final Attributes1 pathAttributes1 = ((Attributes) attribute).augmentation(Attributes1.class);
         if (pathAttributes1 == null) {
             return;
         }
index 7a534919b24ead250c438928ce2051f6e152a201..fb6016f7dbfe4342ac3b854deeea053a28662069 100644 (file)
@@ -144,8 +144,8 @@ public final class LinkstateNlriParser implements NlriParser, NlriSerializer {
         Preconditions.checkArgument(attribute instanceof Attributes,
                 "Attribute parameter is not a PathAttribute object.");
         final Attributes pathAttributes = (Attributes) attribute;
-        final Attributes1 pathAttributes1 = pathAttributes.getAugmentation(Attributes1.class);
-        final Attributes2 pathAttributes2 = pathAttributes.getAugmentation(Attributes2.class);
+        final Attributes1 pathAttributes1 = pathAttributes.augmentation(Attributes1.class);
+        final Attributes2 pathAttributes2 = pathAttributes.augmentation(Attributes2.class);
         if (pathAttributes1 != null) {
             serializeAdvertisedRoutes(pathAttributes1.getMpReachNlri().getAdvertizedRoutes(), byteAggregator);
         } else if (pathAttributes2 != null) {
index e67351127060aabf4d7b795d06ed164ecae6c48c..c50d63e1636c68262bdc7bd5227b9a6f11bc2b02 100644 (file)
@@ -12,6 +12,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+
 import com.google.common.collect.Lists;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -196,7 +197,7 @@ public class LinkstateAttributeParserTest {
     public void testPositiveLinks() throws BGPParsingException {
         final AttributesBuilder builder = createBuilder(new LinkCaseBuilder().build());
         this.parser.parseAttribute(Unpooled.copiedBuffer(LINK_ATTR), builder);
-        final Attributes1 attrs = builder.getAugmentation(Attributes1.class);
+        final Attributes1 attrs = builder.augmentation(Attributes1.class);
         final LinkAttributes ls = ((LinkAttributesCase) attrs.getLinkStateAttribute()).getLinkAttributes();
         assertNotNull(ls);
 
@@ -240,7 +241,7 @@ public class LinkstateAttributeParserTest {
         final AttributesBuilder builder = createBuilder(new NodeCaseBuilder().build());
         this.parser.parseAttribute(Unpooled.copiedBuffer(NODE_ATTR), builder);
 
-        final Attributes1 attrs = builder.getAugmentation(Attributes1.class);
+        final Attributes1 attrs = builder.augmentation(Attributes1.class);
         final NodeAttributes ls = ((NodeAttributesCase) attrs.getLinkStateAttribute()).getNodeAttributes();
         assertNotNull(ls);
 
@@ -270,7 +271,7 @@ public class LinkstateAttributeParserTest {
             new PrefixDescriptorsBuilder().setIpReachabilityInformation(new IpPrefix(new Ipv4Prefix("127.0.0.1/32"))).build()).build());
         this.parser.parseAttribute(Unpooled.copiedBuffer(P4_ATTR), builder);
 
-        final Attributes1 attrs = builder.getAugmentation(Attributes1.class);
+        final Attributes1 attrs = builder.augmentation(Attributes1.class);
         final PrefixAttributes ls = ((PrefixAttributesCase) attrs.getLinkStateAttribute()).getPrefixAttributes();
         assertNotNull(ls);
 
@@ -305,7 +306,7 @@ public class LinkstateAttributeParserTest {
         final AttributesBuilder builder = createBuilder(new TeLspCaseBuilder().build());
         this.parser.parseAttribute(Unpooled.copiedBuffer(TE_LSP_ATTR), builder);
 
-        final Attributes1 attrs = builder.getAugmentation(Attributes1.class);
+        final Attributes1 attrs = builder.augmentation(Attributes1.class);
         final TeLspAttributes teLspAttributes = ((TeLspAttributesCase) attrs.getLinkStateAttribute()).getTeLspAttributes();
         assertNotNull(teLspAttributes);
         final TspecObject tSpec = teLspAttributes.getTspecObject();
index 6088cc076b80f170808fc935305711d175ab3395..20f0d94bf538859332f1cafcfbc99030f91f4a7b 100644 (file)
@@ -110,7 +110,7 @@ public final class LinkstateRIBSupportTest extends AbstractRIBSupportTest<Linkst
         SimpleNlriTypeRegistry.getInstance().serializeNlriType(LINKSTATE_DESTINATION, buffer);
         final byte[] arrayKey = ByteArray.readAllBytes(buffer);
         ROUTE_KEY = new LinkstateRouteKey(PATH_ID, Arrays.toString(arrayKey));
-        ROUTE = new LinkstateRouteBuilder().setKey(ROUTE_KEY).setRouteDistinguisher(RD)
+        ROUTE = new LinkstateRouteBuilder().withKey(ROUTE_KEY).setRouteDistinguisher(RD)
                 .setIdentifier(ID).setObjectType(OBJECT_TYPE2)
                 .setProtocolId(ProtocolId.IsisLevel1).setAttributes(new AttributesBuilder().build()).build();
         ROUTES = new LinkstateRoutesBuilder().setLinkstateRoute(Collections.singletonList(ROUTE)).build();
@@ -148,17 +148,17 @@ public final class LinkstateRIBSupportTest extends AbstractRIBSupportTest<Linkst
     @Test
     public void testBuildMpUnreachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(), createRoutes(ROUTES), ATTRIBUTES);
-        assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class)
+        assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class)
             .getMpUnreachNlri().getWithdrawnRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes1.class));
+        assertNull(update.getAttributes().augmentation(Attributes1.class));
     }
 
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Update update = this.ribSupport.buildUpdate(createRoutes(ROUTES), Collections.emptyList(), ATTRIBUTES);
-        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class)
+        assertEquals(REACH_NLRI, update.getAttributes().augmentation(Attributes1.class)
                 .getMpReachNlri().getAdvertizedRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes2.class));
+        assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
 
     @Test
@@ -222,4 +222,4 @@ public final class LinkstateRIBSupportTest extends AbstractRIBSupportTest<Linkst
         final Collection<DataTreeCandidateNode> result = this.ribSupport.changedRoutes(tree);
         Assert.assertFalse(result.isEmpty());
     }
-}
\ No newline at end of file
+}
index 670acea60731cc863b40a10277f12f75b23d920e..15130dec08fcbee4cfa8094761463def984c7194 100644 (file)
@@ -158,9 +158,9 @@ public class ParserTest {
         final Update message = ParserTest.updateParser.parseMessageBody(Unpooled.copiedBuffer(body), messageLength);
 
         final Class<? extends AddressFamily> afi = message.getAttributes()
-            .getAugmentation(Attributes2.class).getMpUnreachNlri().getAfi();
+            .augmentation(Attributes2.class).getMpUnreachNlri().getAfi();
         final Class<? extends SubsequentAddressFamily> safi = message.getAttributes()
-            .getAugmentation(Attributes2.class).getMpUnreachNlri().getSafi();
+            .augmentation(Attributes2.class).getMpUnreachNlri().getSafi();
 
         assertEquals(LinkstateAddressFamily.class, afi);
         assertEquals(LinkstateSubsequentAddressFamily.class, safi);
@@ -397,7 +397,7 @@ public class ParserTest {
         paBuilder.setLocalPref(new LocalPrefBuilder().setPref(100L).build());
         assertEquals(paBuilder.getLocalPref(), attrs.getLocalPref());
 
-        final MpReachNlri mp = attrs.getAugmentation(Attributes1.class).getMpReachNlri();
+        final MpReachNlri mp = attrs.augmentation(Attributes1.class).getMpReachNlri();
         assertEquals(mpBuilder.getAfi(), mp.getAfi());
         assertEquals(mpBuilder.getSafi(), mp.getSafi());
         assertEquals(mpBuilder.getCNextHop(), mp.getCNextHop());
@@ -425,7 +425,7 @@ public class ParserTest {
 
         assertEquals(
             lsAttrBuilder.build(),
-            attrs.getAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
+            attrs.augmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp
                 .linkstate.rev180329.Attributes1.class));
 
         final List<CLinkstateDestination> dests = ((DestinationLinkstateCase) mp.getAdvertizedRoutes()
@@ -600,7 +600,7 @@ public class ParserTest {
         paBuilder.addAugmentation(Attributes1.class, lsBuilder.build());
         paBuilder.setUnrecognizedAttributes(Collections.emptyList());
 
-        final MpReachNlri mp = attrs.getAugmentation(Attributes1.class).getMpReachNlri();
+        final MpReachNlri mp = attrs.augmentation(Attributes1.class).getMpReachNlri();
         assertEquals(mpBuilder.getAfi(), mp.getAfi());
         assertEquals(mpBuilder.getSafi(), mp.getSafi());
         assertEquals(mpBuilder.getCNextHop(), mp.getCNextHop());
@@ -661,10 +661,10 @@ public class ParserTest {
         for (final BgpParameters param : open.getBgpParameters()) {
             for (final OptionalCapabilities optCapa : param.getOptionalCapabilities()) {
                 final CParameters cParam = optCapa.getCParameters();
-                if(cParam != null && cParam.getAugmentation(CParameters1.class) != null && cParam.getAugmentation
-                    (CParameters1.class).getMultiprotocolCapability() != null) {
-                    final MultiprotocolCapability mp = cParam
-                        .getAugmentation(CParameters1.class).getMultiprotocolCapability();
+                if(cParam != null && cParam.augmentation(CParameters1.class) != null
+                        && cParam.augmentation(CParameters1.class).getMultiprotocolCapability() != null) {
+                    final MultiprotocolCapability mp = cParam.augmentation(CParameters1.class)
+                            .getMultiprotocolCapability();
                     final BgpTableType type = new BgpTableTypeImpl(mp.getAfi(), mp.getSafi());
                     types.add(type);
                 }
index 925f7baf187fcf083768e05f0fc334d53ebe8bf5..ae81ca31fe8de93a5d27f0ad818457af14ef35cf 100644 (file)
@@ -92,7 +92,7 @@ abstract class AbstractMvpnRIBSupport<C extends Routes & DataObject & ChoiceIn<T
         } else {
             builder = new MvpnRouteBuilder();
         }
-        return builder.setKey(createRouteListKey(pathId, routeKey)).setAttributes(attributes).build();
+        return builder.withKey(createRouteListKey(pathId, routeKey)).setAttributes(attributes).build();
     }
 
     @Override
index 27d4799a75ec7ff7e0d9c3b0b53648154177bb1f..edc2ac8d7fb7567ec55da31ec635a7f8b4007cf3 100644 (file)
@@ -78,7 +78,7 @@ public final class PEDistinguisherLabelsAttributeHandler implements AttributePar
         Preconditions.checkArgument(attribute instanceof Attributes,
                 "Attribute parameter is not a PathAttribute object.");
         final PeDistinguisherLabelsAttributeAugmentation att =
-                ((Attributes) attribute).getAugmentation(PeDistinguisherLabelsAttributeAugmentation.class);
+                ((Attributes) attribute).augmentation(PeDistinguisherLabelsAttributeAugmentation.class);
 
         if (att == null) {
             return;
index b39e0b24febd27abac9b42f6925556396c096105..3c58e54185e91fdf3c562f49e35d9ff4a38ed9e9 100644 (file)
@@ -83,7 +83,7 @@ public final class PMSITunnelAttributeHandler implements AttributeParser, Attrib
         Preconditions.checkArgument(attribute instanceof Attributes,
                 "Attribute parameter is not a PathAttribute object.");
         final PmsiTunnelAugmentation pmsiTunnelAugmentation = ((Attributes) attribute)
-                .getAugmentation(PmsiTunnelAugmentation.class);
+                .augmentation(PmsiTunnelAugmentation.class);
         if (pmsiTunnelAugmentation == null) {
             return;
         }
index f86124749ff1249e6693568a5b4cb02c66db23f2..edbf1f751665667d0ffdf3626acb92ed3a407d80 100644 (file)
@@ -69,8 +69,8 @@ public final class MvpnIpv4NlriHandler implements NlriParser, NlriSerializer {
         Preconditions.checkArgument(attribute instanceof Attributes,
                 "Attribute parameter is not a Attributes object");
         final Attributes pathAttributes = (Attributes) attribute;
-        final Attributes1 pathAttributes1 = pathAttributes.getAugmentation(Attributes1.class);
-        final Attributes2 pathAttributes2 = pathAttributes.getAugmentation(Attributes2.class);
+        final Attributes1 pathAttributes1 = pathAttributes.augmentation(Attributes1.class);
+        final Attributes2 pathAttributes2 = pathAttributes.augmentation(Attributes2.class);
         if (pathAttributes1 != null) {
             final AdvertizedRoutes routes = pathAttributes1.getMpReachNlri().getAdvertizedRoutes();
             if (routes != null && routes.getDestinationType() instanceof DestinationMvpnIpv4AdvertizedCase) {
index 729e07bb60fa5db53823846818a9f7f13d5548b8..04541b00605c4d324f997e223bbf4cb371735c28 100644 (file)
@@ -70,8 +70,8 @@ public final class MvpnIpv6NlriHandler implements NlriParser, NlriSerializer {
         Preconditions.checkArgument(attribute instanceof Attributes,
                 "Attribute parameter is not a Attributes object");
         final Attributes pathAttributes = (Attributes) attribute;
-        final Attributes1 pathAttributes1 = pathAttributes.getAugmentation(Attributes1.class);
-        final Attributes2 pathAttributes2 = pathAttributes.getAugmentation(Attributes2.class);
+        final Attributes1 pathAttributes1 = pathAttributes.augmentation(Attributes1.class);
+        final Attributes2 pathAttributes2 = pathAttributes.augmentation(Attributes2.class);
         if (pathAttributes1 != null) {
             final AdvertizedRoutes routes = pathAttributes1.getMpReachNlri().getAdvertizedRoutes();
             if (routes != null && routes.getDestinationType() instanceof DestinationMvpnIpv6AdvertizedCase) {
index e4517c8f26c854f5ac0a9818b55ff57e5c0c6fce..9f8a9b529a36168d221899117c90a93a9f1992e6 100644 (file)
@@ -123,18 +123,18 @@ public class MvpnIpv4RIBSupportTest extends AbstractRIBSupportTest<MvpnRoutesIpv
     public void testBuildMpUnreachNlriUpdate() {
         final Collection<MapEntryNode> routes = createRoutes(MVPN_ROUTES);
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(), routes, ATTRIBUTES);
-        assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri()
+        assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class).getMpUnreachNlri()
                 .getWithdrawnRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes1.class));
+        assertNull(update.getAttributes().augmentation(Attributes1.class));
     }
 
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Collection<MapEntryNode> routes = createRoutes(MVPN_ROUTES);
         final Update update = this.ribSupport.buildUpdate(routes, Collections.emptyList(), ATTRIBUTES);
-        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri()
+        assertEquals(REACH_NLRI, update.getAttributes().augmentation(Attributes1.class).getMpReachNlri()
                 .getAdvertizedRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes2.class));
+        assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
 
     @Test
index ac23ea6a17e69a38ce2fe394398bc524c73c078e..cac43513505ea12b5c9d6eeb88b608e61e0e3d77 100644 (file)
@@ -122,18 +122,18 @@ public final class MvpnIpv6RIBSupportTest extends AbstractRIBSupportTest<MvpnRou
     public void testBuildMpUnreachNlriUpdate() {
         final Collection<MapEntryNode> routes = createRoutes(MVPN_ROUTES);
         final Update update = this.ribSupport.buildUpdate(Collections.emptyList(), routes, ATTRIBUTES);
-        assertEquals(UNREACH_NLRI, update.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri()
+        assertEquals(UNREACH_NLRI, update.getAttributes().augmentation(Attributes2.class).getMpUnreachNlri()
                 .getWithdrawnRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes1.class));
+        assertNull(update.getAttributes().augmentation(Attributes1.class));
     }
 
     @Test
     public void testBuildMpReachNlriUpdate() {
         final Collection<MapEntryNode> routes = createRoutes(MVPN_ROUTES);
         final Update update = this.ribSupport.buildUpdate(routes, Collections.emptyList(), ATTRIBUTES);
-        assertEquals(REACH_NLRI, update.getAttributes().getAugmentation(Attributes1.class).getMpReachNlri()
+        assertEquals(REACH_NLRI, update.getAttributes().augmentation(Attributes1.class).getMpReachNlri()
                 .getAdvertizedRoutes().getDestinationType());
-        assertNull(update.getAttributes().getAugmentation(Attributes2.class));
+        assertNull(update.getAttributes().augmentation(Attributes2.class));
     }
 
     @Test
index fa9919ff2eda6a0f0ebccf17c4dfdb8b9499b8a6..7f69af6a3c2b32eaa3246e0497e89919fa7fae01 100644 (file)
@@ -122,7 +122,7 @@ final class ActionsRegistryImpl {
             return null;
         }
         Attributes attributesUpdated = attributes;
-        final Actions1 augmentation = actions.getAugmentation(Actions1.class);
+        final Actions1 augmentation = actions.augmentation(Actions1.class);
         if (augmentation != null && augmentation.getBgpActions() != null) {
             final BgpActions bgpAction = augmentation.getBgpActions();
 
@@ -255,7 +255,7 @@ final class ActionsRegistryImpl {
             return null;
         }
         Attributes attributesUpdated = attributes;
-        final Actions1 augmentation = actions.getAugmentation(Actions1.class);
+        final Actions1 augmentation = actions.augmentation(Actions1.class);
 
         if (augmentation != null && augmentation.getBgpActions() != null) {
             final BgpActions bgpAction = augmentation.getBgpActions();
index 561bc625aabc4c80590ab92e43e8dbec4c304ddc..7626a1db0002ba55b35c9ba157c33ab4cca6a23b 100644 (file)
@@ -83,7 +83,7 @@ final class BgpConditionsRegistry {
             final BGPRouteEntryExportParameters routeEntryExportParameters,
             final Attributes attributes,
             final Conditions conditions) {
-        final Conditions1 bgpConditionsAug = conditions.getAugmentation(Conditions1.class);
+        final Conditions1 bgpConditionsAug = conditions.augmentation(Conditions1.class);
         if (bgpConditionsAug != null) {
 
             final BgpConditions bgpConditions = bgpConditionsAug.getBgpConditions();
@@ -115,7 +115,7 @@ final class BgpConditionsRegistry {
             final Attributes attributes,
             final Conditions conditions) {
 
-        final Conditions1 bgpConditionsAug = conditions.getAugmentation(Conditions1.class);
+        final Conditions1 bgpConditionsAug = conditions.augmentation(Conditions1.class);
         if (bgpConditionsAug != null) {
             final BgpConditions bgpConditions = bgpConditionsAug.getBgpConditions();
             synchronized (this) {
index 0e30ca10a3d227b7bb034ff13b23344f572b5124..8b5f75538feeb4f2bf297dffa924a56e0a1dc7bb 100644 (file)
@@ -361,11 +361,11 @@ public class StateProviderImplTest extends ConstantSchemaAbstractDataBrokerTest
             assertEquals(expectedTimers, neighborResult.getTimers());
             final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group
                     .State stateResult = neighborResult.getState();
-            assertEquals(expectedBgpNeighborState, stateResult.getAugmentation(BgpNeighborStateAugmentation.class));
+            assertEquals(expectedBgpNeighborState, stateResult.augmentation(BgpNeighborStateAugmentation.class));
             assertEquals(BgpNeighborState.SessionState.ESTABLISHED, stateResult
-                    .getAugmentation(NeighborStateAugmentation.class).getSessionState());
+                    .augmentation(NeighborStateAugmentation.class).getSessionState());
             final List<Class<? extends BgpCapability>> supportedCapabilitiesResult = stateResult
-                    .getAugmentation(NeighborStateAugmentation.class).getSupportedCapabilities();
+                    .augmentation(NeighborStateAugmentation.class).getSupportedCapabilities();
             Assert.assertTrue(supportedCapabilitiesResult.containsAll(this.supportedCap));
             return bgpRib;
         });
index b55d854a7344892e2dd77ae6ae558e99b79df51e..cc3bc0c8526f8959a8e4db6b1b4a9534e2696fef 100644 (file)
@@ -48,11 +48,14 @@ public class AddPathCapabilityHandler implements CapabilityParser, CapabilitySer
 
     @Override
     public void serializeCapability(final CParameters capability, final ByteBuf byteAggregator) {
-        if ( (capability.getAugmentation(CParameters1.class) == null)
-            || (capability.getAugmentation(CParameters1.class).getAddPathCapability() == null) ) {
+        final CParameters1 aug = capability.augmentation(CParameters1.class);
+        if (aug == null) {
+            return;
+        }
+        final AddPathCapability addPathCap = aug.getAddPathCapability();
+        if (addPathCap == null) {
             return;
         }
-        final AddPathCapability addPathCap = capability.getAugmentation(CParameters1.class).getAddPathCapability();
 
         final List<AddressFamilies> families = addPathCap.getAddressFamilies();
         if (families != null) {
index c2cab23ecb0977a28a8f5155c3872d278316d094..f531f1fc56081023fe896f84a6b700dff31941a6 100644 (file)
@@ -91,8 +91,8 @@ public final class GracefulCapabilityHandler implements CapabilityParser, Capabi
 
     private ByteBuf serializeCapability(final GracefulRestartCapability grace) {
         final List<Tables> tables = grace.getTables();
-        final int tablesSize = (tables != null) ? tables.size() : 0;
-        final ByteBuf bytes = Unpooled.buffer(HEADER_SIZE + (PER_AFI_SAFI_SIZE * tablesSize));
+        final int tablesSize = tables != null ? tables.size() : 0;
+        final ByteBuf bytes = Unpooled.buffer(HEADER_SIZE + PER_AFI_SAFI_SIZE * tablesSize);
         int timeval = 0;
         Integer time = grace.getRestartTime();
         if (time == null) {
@@ -112,22 +112,22 @@ public final class GracefulCapabilityHandler implements CapabilityParser, Capabi
 
     @Override
     public void serializeCapability(final CParameters capability, final ByteBuf byteAggregator) {
-        if (capability.getAugmentation(CParameters1.class) == null
-            || capability.getAugmentation(CParameters1.class).getGracefulRestartCapability() == null) {
+        final CParameters1 aug = capability.augmentation(CParameters1.class);
+        if (aug == null) {
             return;
         }
-        final GracefulRestartCapability grace = capability.getAugmentation(CParameters1.class).getGracefulRestartCapability();
-
-        final ByteBuf bytes = serializeCapability(grace);
-
-        CapabilityUtil.formatCapability(CODE, bytes, byteAggregator);
+        final GracefulRestartCapability grace = aug.getGracefulRestartCapability();
+        if (grace != null) {
+            final ByteBuf bytes = serializeCapability(grace);
+            CapabilityUtil.formatCapability(CODE, bytes, byteAggregator);
+        }
     }
 
     @Override
     public CParameters parseCapability(final ByteBuf buffer) throws BGPDocumentedException, BGPParsingException {
         final GracefulRestartCapabilityBuilder cb = new GracefulRestartCapabilityBuilder();
 
-        final int flagBits = (buffer.getByte(0) >> RESTART_FLAGS_SIZE);
+        final int flagBits = buffer.getByte(0) >> RESTART_FLAGS_SIZE;
         cb.setRestartFlags(new RestartFlags((flagBits & Byte.SIZE) != 0));
 
         final int timer = ((buffer.readUnsignedByte() & TIMER_TOPBITS_MASK) << Byte.SIZE) + buffer.readUnsignedByte();
index 7fcc312d34d988ac25cfb0f81684c1c4ed984933..854ddfafc0c8fbfddc06c7153846ba02594f45ba 100644 (file)
@@ -52,11 +52,14 @@ public final class MultiProtocolCapabilityHandler implements CapabilityParser, C
 
     @Override
     public void serializeCapability(final CParameters capability, final ByteBuf byteAggregator) {
-        if ( capability.getAugmentation(CParameters1.class) == null
-            || capability.getAugmentation(CParameters1.class).getMultiprotocolCapability() == null ) {
+        final CParameters1 aug = capability.augmentation(CParameters1.class);
+        if (aug == null) {
+            return;
+        }
+        final MultiprotocolCapability mp = aug.getMultiprotocolCapability();
+        if (mp == null) {
             return;
         }
-        final MultiprotocolCapability mp = capability.getAugmentation(CParameters1.class).getMultiprotocolCapability();
 
         final ByteBuf capBuffer = Unpooled.buffer();
         MultiprotocolCapabilitiesUtil.serializeMPAfiSafi(this.afiReg, this.safiReg, mp.getAfi(),
index 00cfc9ed832f70d4e2aecf0b92d0e9bd1d32cf30..7cd40a185cbfb32cbe1c713412a1c19646cd23bd 100644 (file)
@@ -25,11 +25,12 @@ public class RouteRefreshCapabilityHandler implements CapabilityParser, Capabili
 
     @Override
     public void serializeCapability(final CParameters capability, final ByteBuf byteAggregator) {
-        if (capability == null || (capability.getAugmentation(CParameters1.class) == null) ||
-            (capability.getAugmentation(CParameters1.class).getRouteRefreshCapability() == null) ) {
-            return;
+        if (capability != null) {
+            final CParameters1 aug = capability.augmentation(CParameters1.class);
+            if (aug != null && aug.getRouteRefreshCapability() != null) {
+                CapabilityUtil.formatCapability(CODE, Unpooled.EMPTY_BUFFER, byteAggregator);
+            }
         }
-        CapabilityUtil.formatCapability(CODE, Unpooled.EMPTY_BUFFER, byteAggregator);
     }
 
     @Override
index dbc7416c06e18c84d19d4faae1a4a51c5b30aeb4..ad3c9c2a30e97a0953b7e31433821f6e9edfde53 100644 (file)
@@ -56,7 +56,7 @@ public final class MPReachAttributeParser extends ReachAttributeParser{
         Preconditions.checkArgument(attribute instanceof Attributes,
                 "Attribute parameter is not a PathAttribute object.");
         final Attributes pathAttributes = (Attributes) attribute;
-        final Attributes1 pathAttributes1 = pathAttributes.getAugmentation(Attributes1.class);
+        final Attributes1 pathAttributes1 = pathAttributes.augmentation(Attributes1.class);
         if (pathAttributes1 == null) {
             return;
         }
index 45b6cfe5530c73ff66ed56e16f4c05b90b114c99..19eeb0db057fad27e91110e327eb7737005b393c 100644 (file)
@@ -55,7 +55,7 @@ public final class MPUnreachAttributeParser extends ReachAttributeParser {
         Preconditions.checkArgument(attribute instanceof Attributes,
                 "Attribute parameter is not a PathAttribute object.");
         final Attributes pathAttributes = (Attributes) attribute;
-        final Attributes2 pathAttributes2 = pathAttributes.getAugmentation(Attributes2.class);
+        final Attributes2 pathAttributes2 = pathAttributes.augmentation(Attributes2.class);
         if (pathAttributes2 == null) {
             return;
         }
index c4e2a56cfc2c03e27ca17510aed65ccb1dc8a970..d1534f4a06fb2143996cdc18688fbfa5e7a51060 100644 (file)
@@ -514,8 +514,8 @@ public class BGPParserTest {
         final int messageLength = ByteArray.bytesToInt(ByteArray.subByte(inputBytes.get(6), MessageUtil.MARKER_LENGTH, LENGTH_FIELD_LENGTH));
         final Update message = BGPParserTest.updateParser.parseMessageBody(Unpooled.copiedBuffer(body), messageLength);
 
-        final Class<? extends AddressFamily> afi = message.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri().getAfi();
-        final Class<? extends SubsequentAddressFamily> safi = message.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri().getSafi();
+        final Class<? extends AddressFamily> afi = message.getAttributes().augmentation(Attributes2.class).getMpUnreachNlri().getAfi();
+        final Class<? extends SubsequentAddressFamily> safi = message.getAttributes().augmentation(Attributes2.class).getMpUnreachNlri().getSafi();
 
         assertEquals(Ipv6AddressFamily.class, afi);
         assertEquals(UnicastSubsequentAddressFamily.class, safi);
@@ -545,8 +545,8 @@ public class BGPParserTest {
         final int messageLength = ByteArray.bytesToInt(ByteArray.subByte(inputBytes.get(6), MessageUtil.MARKER_LENGTH, LENGTH_FIELD_LENGTH));
         final Update message = BGPParserTest.updateParser.parseMessageBody(Unpooled.copiedBuffer(body), messageLength);
 
-        final Class<? extends AddressFamily> afi = message.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri().getAfi();
-        final Class<? extends SubsequentAddressFamily> safi = message.getAttributes().getAugmentation(Attributes2.class).getMpUnreachNlri().getSafi();
+        final Class<? extends AddressFamily> afi = message.getAttributes().augmentation(Attributes2.class).getMpUnreachNlri().getAfi();
+        final Class<? extends SubsequentAddressFamily> safi = message.getAttributes().augmentation(Attributes2.class).getMpUnreachNlri().getSafi();
 
         assertEquals(Ipv6AddressFamily.class, afi);
         assertEquals(UnicastSubsequentAddressFamily.class, safi);
index 1e70f5820079f49ae96e31730d9b999425835616..832ab8f25bf3e41aed041fb156fadc90ed523e14 100644 (file)
@@ -64,9 +64,9 @@ public class OpenTest {
         assertEquals(open.getBgpParameters().get(0).getOptionalCapabilities().get(0).getCParameters().getAs4BytesCapability(),
             openResult.getBgpParameters().get(0).getOptionalCapabilities().get(!grace ? 1 : 0).getCParameters().getAs4BytesCapability());
         assertEquals(open.getBgpParameters().get(0).getOptionalCapabilities().get(0).getCParameters()
-            .getAugmentation(CParameters1.class)
+            .augmentation(CParameters1.class)
             .getGracefulRestartCapability(), openResult.getBgpParameters().get(0).getOptionalCapabilities().get(grace ? 1 : 0).getCParameters()
-                .getAugmentation(CParameters1.class).getGracefulRestartCapability());
+                .augmentation(CParameters1.class).getGracefulRestartCapability());
 
     }
 }
index 20e026b9bcdaa982f7da69288726fd955b80e052..9d64ee6e798bb903a8859bfd1c23a3fae049851f 100644 (file)
@@ -200,11 +200,11 @@ public class BGPMessageParserMockTest {
                 .getBgpParameters()) {
             for (final OptionalCapabilities capa : p.getOptionalCapabilities()) {
                 final CParameters cp = capa.getCParameters();
-                if (cp.getAugmentation(CParameters1.class) != null && cp.getAugmentation(CParameters1.class)
+                if (cp.augmentation(CParameters1.class) != null && cp.augmentation(CParameters1.class)
                         .getMultiprotocolCapability() != null) {
-                    final BgpTableType t = new BgpTableTypeImpl(cp.getAugmentation(CParameters1.class)
+                    final BgpTableType t = new BgpTableTypeImpl(cp.augmentation(CParameters1.class)
                             .getMultiprotocolCapability().getAfi(),
-                            cp.getAugmentation(CParameters1.class).getMultiprotocolCapability().getSafi());
+                            cp.augmentation(CParameters1.class).getMultiprotocolCapability().getSafi());
                     result.add(t);
                 }
             }
index dd03b10023eb055ed7f8acf3b39baa6906332d5b..d30b8a96050b9f984b8845e9cdabc505412a18b5 100755 (executable)
@@ -72,8 +72,11 @@ public final class MessageUtil {
      * @return MP-REACH-NLRI if present in the attributes, null otherwise
      */
     public static MpReachNlri getMpReachNlri(final Attributes attrs) {
-        if (attrs != null && attrs.getAugmentation(Attributes1.class) != null) {
-            return attrs.getAugmentation(Attributes1.class).getMpReachNlri();
+        if (attrs != null) {
+            final Attributes1 aug = attrs.augmentation(Attributes1.class);
+            if (aug != null) {
+                return aug.getMpReachNlri();
+            }
         }
 
         return null;
@@ -86,8 +89,11 @@ public final class MessageUtil {
      * @return MP-UNREACH-NLRI if present in the attributes, null otherwise
      */
     public static MpUnreachNlri getMpUnreachNlri(final Attributes attrs) {
-        if (attrs != null && attrs.getAugmentation(Attributes2.class) != null) {
-            return attrs.getAugmentation(Attributes2.class).getMpUnreachNlri();
+        if (attrs != null) {
+            final Attributes2 aug =  attrs.augmentation(Attributes2.class);
+            if (aug != null) {
+                return aug.getMpUnreachNlri();
+            }
         }
 
         return null;
index 7dc38bfadea9c295bcf0667ac0b2e099c9c6e7c3..50c6f4cc0e0774c2c0fbe75a97befdd6abc0b566 100644 (file)
@@ -89,7 +89,7 @@ final class SimpleAttributeRegistry implements AttributeRegistry {
             throws BGPDocumentedException {
         final BitArray flags = BitArray.valueOf(buffer.readByte());
         final int type = buffer.readUnsignedByte();
-        final int len = (flags.get(EXTENDED_LENGTH_BIT)) ? buffer.readUnsignedShort() : buffer.readUnsignedByte();
+        final int len = flags.get(EXTENDED_LENGTH_BIT) ? buffer.readUnsignedShort() : buffer.readUnsignedByte();
         if (!attributes.containsKey(type)) {
             final AttributeParser parser = this.handlers.getParser(type);
             if (parser == null) {
@@ -107,7 +107,7 @@ final class SimpleAttributeRegistry implements AttributeRegistry {
             throw new BGPDocumentedException("Well known attribute not recognized.", BGPError.WELL_KNOWN_ATTR_NOT_RECOGNIZED);
         }
         final UnrecognizedAttributes unrecognizedAttribute = new UnrecognizedAttributesBuilder()
-            .setKey(new UnrecognizedAttributesKey((short) type))
+            .withKey(new UnrecognizedAttributesKey((short) type))
             .setPartial(flags.get(PARTIAL_BIT))
             .setTransitive(flags.get(TRANSITIVE_BIT))
             .setType((short) type)
index 3a0f008c024cae17169ee8e61149e05d20b95d99..e7671d22a58c766247f17344624de62b07e7b538 100644 (file)
@@ -57,6 +57,6 @@ public class UnrecognizedAttributesTest {
         assertTrue(unrecogAttrib.isTransitive());
         assertArrayEquals(ByteArray.cutBytes(attributeBytes, NON_VALUE_BYTES), unrecogAttrib.getValue());
         assertEquals(NON_EXISTENT_TYPE, unrecogAttrib.getType().shortValue());
-        assertEquals(expectedAttribKey, unrecogAttrib.getKey());
+        assertEquals(expectedAttribKey, unrecogAttrib.key());
     }
 }
index 5182596d2616579b3e5828d456c15702d9b7b895..28d98d89ba88b76e94f7b0d6b4cb1aaa9ff20a12 100644 (file)
@@ -129,7 +129,7 @@ public class BGPSessionImpl extends SimpleChannelInboundHandler<Notification> im
         this.channel = requireNonNull(channel);
         this.limiter = new ChannelOutputLimiter(this);
         this.channel.pipeline().addLast(this.limiter);
-        this.holdTimerValue = (remoteOpen.getHoldTimer() < localHoldTimer) ? remoteOpen.getHoldTimer() : localHoldTimer;
+        this.holdTimerValue = remoteOpen.getHoldTimer() < localHoldTimer ? remoteOpen.getHoldTimer() : localHoldTimer;
         LOG.info("BGP HoldTimer new value: {}", this.holdTimerValue);
         this.keepAlive = this.holdTimerValue / KA_TO_DEADTIMER_RATIO;
         this.asNumber = AsNumberUtil.advertizedAsNumber(remoteOpen);
@@ -143,17 +143,17 @@ public class BGPSessionImpl extends SimpleChannelInboundHandler<Notification> im
             for (final BgpParameters param : remoteOpen.getBgpParameters()) {
                 for (final OptionalCapabilities optCapa : param.getOptionalCapabilities()) {
                     final CParameters cParam = optCapa.getCParameters();
-                    if (cParam.getAugmentation(CParameters1.class) == null) {
+                    if (cParam.augmentation(CParameters1.class) == null) {
                         continue;
                     }
-                    if (cParam.getAugmentation(CParameters1.class).getMultiprotocolCapability() != null) {
-                        final MultiprotocolCapability multi = cParam.getAugmentation(CParameters1.class).getMultiprotocolCapability();
+                    if (cParam.augmentation(CParameters1.class).getMultiprotocolCapability() != null) {
+                        final MultiprotocolCapability multi = cParam.augmentation(CParameters1.class).getMultiprotocolCapability();
                         final TablesKey tt = new TablesKey(multi.getAfi(), multi.getSafi());
                         LOG.trace("Added table type to sync {}", tt);
                         tts.add(tt);
                         tats.add(new BgpTableTypeImpl(tt.getAfi(), tt.getSafi()));
-                    } else if (cParam.getAugmentation(CParameters1.class).getAddPathCapability() != null) {
-                        final AddPathCapability addPathCap = cParam.getAugmentation(CParameters1.class).getAddPathCapability();
+                    } else if (cParam.augmentation(CParameters1.class).getAddPathCapability() != null) {
+                        final AddPathCapability addPathCap = cParam.augmentation(CParameters1.class).getAddPathCapability();
                         addPathCapabilitiesList.addAll(addPathCap.getAddressFamilies());
                     }
                 }
index 80f513ace2ecb9afdf85510e19829f03df10dad9..653527feaa87838341b9b0c4fa4a572af30135bd 100644 (file)
@@ -82,13 +82,13 @@ public class BGPSynchronization {
         boolean isEOR = false;
         if (msg.getNlri() == null && msg.getWithdrawnRoutes() == null) {
             if (msg.getAttributes() != null) {
-                if (msg.getAttributes().getAugmentation(Attributes1.class) != null) {
-                    final Attributes1 pa = msg.getAttributes().getAugmentation(Attributes1.class);
+                if (msg.getAttributes().augmentation(Attributes1.class) != null) {
+                    final Attributes1 pa = msg.getAttributes().augmentation(Attributes1.class);
                     if (pa.getMpReachNlri() != null) {
                         type = new TablesKey(pa.getMpReachNlri().getAfi(), pa.getMpReachNlri().getSafi());
                     }
-                } else if (msg.getAttributes().getAugmentation(Attributes2.class) != null) {
-                    final Attributes2 pa = msg.getAttributes().getAugmentation(Attributes2.class);
+                } else if (msg.getAttributes().augmentation(Attributes2.class) != null) {
+                    final Attributes2 pa = msg.getAttributes().augmentation(Attributes2.class);
                     if (pa.getMpUnreachNlri() != null) {
                         type = new TablesKey(pa.getMpUnreachNlri().getAfi(), pa.getMpUnreachNlri().getSafi());
                     }
index 70de8d0ad913e9c9be8b59067bed0cc354211e29..98a48e90e1ba002b808582b248b2bc9ae0497905 100644 (file)
@@ -140,7 +140,7 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
             switch (modificationType) {
                 case DELETE:
                     final Tables removeTable = table.getDataBefore();
-                    final TablesKey tableKey = removeTable.getKey();
+                    final TablesKey tableKey = removeTable.key();
                     final KeyedInstanceIdentifier<Tables, TablesKey> effectiveTablePath
                             = this.effRibTables.child(Tables.class, tableKey);
                     LOG.debug("Delete Effective Table {} modification type {}, "
@@ -151,7 +151,7 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
                 case SUBTREE_MODIFIED:
                     final Tables before = table.getDataBefore();
                     final Tables after = table.getDataAfter();
-                    final TablesKey tk = after.getKey();
+                    final TablesKey tk = after.key();
                     LOG.debug("Process table {} type {}, dataAfter {}, dataBefore {}",
                             tk, modificationType, after, before);
 
@@ -244,7 +244,7 @@ final class EffectiveRibInWriter implements PrefixesReceivedCounters, PrefixesIn
         if (newTable == null) {
             return;
         }
-        final TablesKey tableKey = newTable.getKey();
+        final TablesKey tableKey = newTable.key();
         final KeyedInstanceIdentifier<Tables, TablesKey> tablePath
                 = this.effRibTables.child(Tables.class, tableKey);
 
index a125f3788fb1e5949e03187a2e2f92033906ab1d..2ee0cd7d9a661dddcb4f23f0c7d9f171e5dae579 100644 (file)
@@ -100,7 +100,7 @@ public final class AppPeer implements PeerBean, BGPPeerStateConsumer {
 
     @Override
     public synchronized Boolean containsEqualConfiguration(final Neighbor neighbor) {
-        return Objects.equals(this.currentConfiguration.getKey(), neighbor.getKey())
+        return Objects.equals(this.currentConfiguration.key(), neighbor.key())
                 && OpenConfigMappingUtil.isApplicationPeer(neighbor);
     }
 
index ef65402305a8f2d52992c364e7483c5eccbdbaa3..6131bb3ca132f3134dd2eeeee2fe3306467bce81 100644 (file)
@@ -242,7 +242,7 @@ public final class BGPClusterSingletonService implements ClusterSingletonService
 
     private synchronized void onNeighborModified(final Neighbor neighbor) {
         //restart peer instance with a new configuration
-        final PeerBean bgpPeer = this.peers.get(getNeighborInstanceIdentifier(this.bgpIid, neighbor.getKey()));
+        final PeerBean bgpPeer = this.peers.get(getNeighborInstanceIdentifier(this.bgpIid, neighbor.key()));
         if (bgpPeer == null) {
             onNeighborCreated(neighbor);
         } else if (!bgpPeer.containsEqualConfiguration(neighbor)) {
@@ -260,7 +260,7 @@ public final class BGPClusterSingletonService implements ClusterSingletonService
             bgpPeer = (PeerBean) this.container.getComponentInstance(InstanceType.PEER.getBeanName());
         }
         final InstanceIdentifier<Neighbor> neighborInstanceIdentifier =
-                getNeighborInstanceIdentifier(this.bgpIid, neighbor.getKey());
+                getNeighborInstanceIdentifier(this.bgpIid, neighbor.key());
         initiatePeerInstance(neighborInstanceIdentifier, neighbor, bgpPeer);
         this.peers.put(neighborInstanceIdentifier, bgpPeer);
 
@@ -280,7 +280,7 @@ public final class BGPClusterSingletonService implements ClusterSingletonService
         if (config == null) {
             return null;
         }
-        final NeighborPeerGroupConfig aug = config.getAugmentation(NeighborPeerGroupConfig.class);
+        final NeighborPeerGroupConfig aug = config.augmentation(NeighborPeerGroupConfig.class);
         return aug == null ? null : aug.getPeerGroup();
     }
 
@@ -289,7 +289,7 @@ public final class BGPClusterSingletonService implements ClusterSingletonService
         closePeer(bgpPeer);
 
         final InstanceIdentifier<Neighbor> neighborInstanceIdentifier
-                = getNeighborInstanceIdentifier(this.bgpIid, neighbor.getKey());
+                = getNeighborInstanceIdentifier(this.bgpIid, neighbor.key());
         initiatePeerInstance(neighborInstanceIdentifier, neighbor, bgpPeer);
         LOG.debug("Peer instance updated {}", bgpPeer);
     }
@@ -308,7 +308,7 @@ public final class BGPClusterSingletonService implements ClusterSingletonService
 
     private synchronized void onNeighborRemoved(final Neighbor neighbor) {
         LOG.debug("Removing Peer instance: {}", neighbor);
-        final PeerBean bgpPeer = this.peers.remove(getNeighborInstanceIdentifier(this.bgpIid, neighbor.getKey()));
+        final PeerBean bgpPeer = this.peers.remove(getNeighborInstanceIdentifier(this.bgpIid, neighbor.key()));
 
         final String groupName = getPeerGroupName(neighbor.getConfig());
         if (groupName != null) {
index efe7cab0003975ff317fe97f809a8095fa17241d..e9df6da34d0d370d76feaecf7f52ab332efbdc90 100644 (file)
@@ -236,7 +236,7 @@ public final class BgpPeer implements PeerBean, BGPPeerStateConsumer {
             String peerGroupName = null;
             final Config neighborConfig = neighbor.getConfig();
             if (neighborConfig != null) {
-                final NeighborPeerGroupConfig pgConfig = neighborConfig.getAugmentation(NeighborPeerGroupConfig.class);
+                final NeighborPeerGroupConfig pgConfig = neighborConfig.augmentation(NeighborPeerGroupConfig.class);
                 if (pgConfig != null) {
                     peerGroupName = StringUtils.substringBetween(pgConfig.getPeerGroup(), "=\"", "\"");
                     peerGroup = peerGroupLoader.getPeerGroup(bgpIid, peerGroupName);
index 99d0bcf13c010c2fb7522f8dba2e3d9bc88a9f57..b557cdc4f5a2c53b584f2931d1f6f85e5ebbc2c9 100644 (file)
@@ -155,11 +155,11 @@ public final class OpenConfigMappingUtil {
         if (transport != null) {
             final Config config = transport.getConfig();
             if (config != null) {
-                final NeighborTransportConfig peerTc = config.getAugmentation(NeighborTransportConfig.class);
+                final NeighborTransportConfig peerTc = config.augmentation(NeighborTransportConfig.class);
                 if (peerTc != null) {
                     return peerTc.getRemotePort();
                 }
-                final PeerGroupTransportConfig peerGroupTc = config.getAugmentation(PeerGroupTransportConfig.class);
+                final PeerGroupTransportConfig peerGroupTc = config.augmentation(PeerGroupTransportConfig.class);
                 if (peerGroupTc != null) {
                     return peerGroupTc.getRemotePort();
                 }
@@ -188,7 +188,7 @@ public final class OpenConfigMappingUtil {
     public static ClusterIdentifier getGlobalClusterIdentifier(final org.opendaylight.yang.gen.v1.http.openconfig.net
             .yang.bgp.rev151009.bgp.global.base.Config globalConfig) {
         final GlobalConfigAugmentation globalConfigAugmentation
-                = globalConfig.getAugmentation(GlobalConfigAugmentation.class);
+                = globalConfig.augmentation(GlobalConfigAugmentation.class);
         if (globalConfigAugmentation != null && globalConfigAugmentation.getRouteReflectorClusterId() != null) {
             return new ClusterIdentifier(globalConfigAugmentation.getRouteReflectorClusterId().getIpv4Address());
         }
@@ -224,7 +224,7 @@ public final class OpenConfigMappingUtil {
             final BGPTableTypeRegistryConsumer tableTypeRegistry, final BGPPeerTracker peerTracker) {
         final Map<BgpTableType, PathSelectionMode> pathSelectionModes = new HashMap<>();
         for (final AfiSafi afiSafi : afiSafis) {
-            final BgpNeighborAddPathsConfig afiSafi2 = afiSafi.getAugmentation(GlobalAddPathsConfig.class);
+            final BgpNeighborAddPathsConfig afiSafi2 = afiSafi.augmentation(GlobalAddPathsConfig.class);
             if (afiSafi2 != null) {
                 final Optional<BgpTableType> bgpTableType = tableTypeRegistry.getTableType(afiSafi.getAfiSafiName());
                 if (bgpTableType.isPresent()) {
@@ -246,7 +246,7 @@ public final class OpenConfigMappingUtil {
         final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group
                 .Config config = neighbor.getConfig();
         if (config != null) {
-            final NeighborPeerGroupConfig config1 = config.getAugmentation(NeighborPeerGroupConfig.class);
+            final NeighborPeerGroupConfig config1 = config.augmentation(NeighborPeerGroupConfig.class);
             if (config1 != null) {
                 final String peerGroup = config1.getPeerGroup();
                 return peerGroup != null && peerGroup.equals(APPLICATION_PEER_GROUP_NAME);
@@ -259,7 +259,7 @@ public final class OpenConfigMappingUtil {
             final BGPTableTypeRegistryConsumer tableTypeRegistry) {
         final List<AddressFamilies> addPathCapability = new ArrayList<>();
         for (final AfiSafi afiSafi : afiSafis) {
-            final BgpNeighborAddPathsConfig afiSafi1 = afiSafi.getAugmentation(NeighborAddPathsConfig.class);
+            final BgpNeighborAddPathsConfig afiSafi1 = afiSafi.augmentation(NeighborAddPathsConfig.class);
             final Optional<BgpTableType> bgpTableType = tableTypeRegistry.getTableType(afiSafi.getAfiSafiName());
             if (afiSafi1 != null && bgpTableType.isPresent()) {
                 final AddressFamiliesBuilder builder = new AddressFamiliesBuilder(bgpTableType.get());
index 77245d01e891e49df847d286b5c09889b1062f6a..ac29826638a347e9fa410d996b0ef33c8c839a3a 100644 (file)
@@ -84,7 +84,7 @@ public final class BGPSessionStateImpl implements BGPSessionState, BGPTimersStat
             for (final BgpParameters parameters : bgpParameters) {
                 for (final OptionalCapabilities optionalCapabilities : parameters.getOptionalCapabilities()) {
                     final CParameters cParam = optionalCapabilities.getCParameters();
-                    final CParameters1 capabilities = cParam.getAugmentation(CParameters1.class);
+                    final CParameters1 capabilities = cParam.augmentation(CParameters1.class);
                     if (capabilities != null) {
                         final MultiprotocolCapability mc = capabilities.getMultiprotocolCapability();
                         if (mc != null) {
@@ -119,7 +119,7 @@ public final class BGPSessionStateImpl implements BGPSessionState, BGPTimersStat
     }
 
     @Override
-    public synchronized void setSessionState(@Nonnull State state) {
+    public synchronized void setSessionState(@Nonnull final State state) {
         if (state == State.IDLE) {
             this.sessionStopwatch.reset();
         } else if (state == State.UP) {
index 8b1f819136023eab766a06ff815f9a8f9a8fae32..82bf6e97779381de03383b37f4509853d9f979db 100644 (file)
@@ -83,18 +83,17 @@ final class EventBusRegistration extends AbstractListenerRegistration<BGPSession
             for (final BgpParameters param : ((Open) message).getBgpParameters()) {
                 for (final OptionalCapabilities capa : param.getOptionalCapabilities()) {
                     final CParameters cParam = capa.getCParameters();
-                    if (cParam.getAugmentation(CParameters1.class) == null) {
+                    final CParameters1 aug = cParam.augmentation(CParameters1.class);
+                    if (aug == null) {
                         continue;
                     }
-                    if (cParam.getAugmentation(CParameters1.class).getMultiprotocolCapability() != null) {
-                        final MultiprotocolCapability p = cParam.getAugmentation(CParameters1.class)
-                                .getMultiprotocolCapability();
+                    if (aug.getMultiprotocolCapability() != null) {
+                        final MultiprotocolCapability p = aug.getMultiprotocolCapability();
                         LOG.debug("Adding open parameter {}", p);
                         final BgpTableType type = new BgpTableTypeImpl(p.getAfi(), p.getSafi());
                         tts.add(type);
-                    } else if (cParam.getAugmentation(CParameters1.class).getAddPathCapability() != null) {
-                        final AddPathCapability addPathCap = cParam.getAugmentation(CParameters1.class)
-                                .getAddPathCapability();
+                    } else if (aug.getAddPathCapability() != null) {
+                        final AddPathCapability addPathCap = aug.getAddPathCapability();
                         addPathCapabilitiesList.addAll(addPathCap.getAddressFamilies());
                     }
                 }
index f1e71d0da2988f3143b3813390e07e1de2884bbe..60f7998c6610e7bad3089fa1d2871dd40af1aa48 100644 (file)
@@ -145,7 +145,7 @@ public abstract class AbstractRIBSupport<
         this.tk = new TablesKey(afiClass, safiClass);
         //FIXME Use Route Case IId instead of Tables IId.
         this.emptyRoutes = (ChoiceNode) ((MapEntryNode) this.mappingService
-                .toNormalizedNode(TABLES_II, new TablesBuilder().setKey(tk)
+                .toNormalizedNode(TABLES_II, new TablesBuilder().withKey(tk)
                         .setRoutes(emptyRoutesCase()).build()).getValue())
                 .getChild(new NodeIdentifier(BindingReflections.findQName(Routes.class))).get();
         this.afiClass = afiClass;
index 23e5cbc9595a6357c8e2716cda2b714bea461936..66fc748e483026711d89764b262ac0ab6c91ae65 100644 (file)
@@ -149,7 +149,7 @@ public abstract class AbstractRIBSupportTest<C extends Routes & DataObject & Cho
     }
 
     protected final ChoiceNode createRoutes(final Routes routes) {
-        final Tables tables = new TablesBuilder().setKey(getTablesKey()).setRoutes(routes).build();
+        final Tables tables = new TablesBuilder().withKey(getTablesKey()).setRoutes(routes).build();
         return (ChoiceNode) ((MapEntryNode) this.mappingService.toNormalizedNode(tablesIId(), tables).getValue())
             .getChild(new NodeIdentifier(BindingReflections.findQName(Routes.class))).get();
     }
index 3cfda8dcd3c03d2b89655aa97553ecc5fe5d7b29..4602a4b5d39689ca03938f3c84ef37b5604222d3 100644 (file)
@@ -113,7 +113,7 @@ abstract class AbstractReachabilityTopologyBuilder<T extends Route> extends Abst
         final InstanceIdentifier<IgpNodeAttributes> ret = nii.builder().augmentation(Node1.class)
                 .child(IgpNodeAttributes.class).build();
 
-        trans.merge(LogicalDatastoreType.OPERATIONAL, nii, new NodeBuilder().setKey(nii.getKey()).setNodeId(ni)
+        trans.merge(LogicalDatastoreType.OPERATIONAL, nii, new NodeBuilder().withKey(nii.getKey()).setNodeId(ni)
             .addAugmentation(Node1.class, new Node1Builder().setIgpNodeAttributes(
                 new IgpNodeAttributesBuilder().setPrefix(Collections.emptyList()).build()).build()).build());
 
@@ -137,7 +137,7 @@ abstract class AbstractReachabilityTopologyBuilder<T extends Route> extends Abst
         final PrefixKey pk = new PrefixKey(prefix);
 
         trans.put(LogicalDatastoreType.OPERATIONAL,
-                nii.child(Prefix.class, pk), new PrefixBuilder().setKey(pk).setPrefix(prefix).build());
+                nii.child(Prefix.class, pk), new PrefixBuilder().withKey(pk).setPrefix(prefix).build());
     }
 
     @Override
index 64ac7dae2c0dca0dd49d72ffc1b3a5951a68961f..3886ec973b4f795443878a63b565afb388366faa 100644 (file)
@@ -240,7 +240,7 @@ public abstract class AbstractTopologyBuilder<T extends Route> implements Cluste
         requireNonNull(this.chain, "A valid transaction chain must be provided.");
         final WriteTransaction trans = this.chain.newWriteOnlyTransaction();
         trans.put(LogicalDatastoreType.OPERATIONAL, this.topology,
-                new TopologyBuilder().setKey(this.topologyKey).setServerProvided(Boolean.TRUE)
+                new TopologyBuilder().withKey(this.topologyKey).setServerProvided(Boolean.TRUE)
                         .setTopologyTypes(this.topologyTypes)
                         .setLink(Collections.emptyList()).setNode(Collections.emptyList()).build(), true);
         trans.commit().addCallback(new FutureCallback<CommitInfo>() {
index 88df736b484470931dbcc35daf7df79374360ce4..6600177d38cb5e702d01439acff24a08433a8c01 100644 (file)
@@ -143,7 +143,7 @@ public class LinkstateTopologyBuilder extends AbstractTopologyBuilder<LinkstateR
 
         private NodeHolder(final NodeId id) {
             this.inab = new IgpNodeAttributesBuilder();
-            this.nb = new NodeBuilder().setKey(new NodeKey(id)).setNodeId(id);
+            this.nb = new NodeBuilder().withKey(new NodeKey(id)).setNodeId(id);
         }
 
         /**
@@ -153,7 +153,7 @@ public class LinkstateTopologyBuilder extends AbstractTopologyBuilder<LinkstateR
          * @return True if the node has been purged, false otherwise.
          */
         private boolean syncState(final WriteTransaction trans) {
-            final InstanceIdentifier<Node> nid = getNodeInstanceIdentifier(this.nb.getKey());
+            final InstanceIdentifier<Node> nid = getNodeInstanceIdentifier(this.nb.key());
 
             /*
              * Transaction's putOperationalData() does a merge. Force it onto a replace
@@ -186,7 +186,7 @@ public class LinkstateTopologyBuilder extends AbstractTopologyBuilder<LinkstateR
         }
 
         private boolean checkForRemoval(final WriteTransaction trans) {
-            final InstanceIdentifier<Node> nid = getNodeInstanceIdentifier(this.nb.getKey());
+            final InstanceIdentifier<Node> nid = getNodeInstanceIdentifier(this.nb.key());
 
             if (!this.advertized) {
                 if (this.tps.isEmpty() && this.prefixes.isEmpty()) {
@@ -219,7 +219,7 @@ public class LinkstateTopologyBuilder extends AbstractTopologyBuilder<LinkstateR
         }
 
         private void addPrefix(final Prefix pfx) {
-            this.prefixes.put(pfx.getKey(), pfx);
+            this.prefixes.put(pfx.key(), pfx);
         }
 
         private void removePrefix(final PrefixCase prefixCase) {
@@ -228,7 +228,7 @@ public class LinkstateTopologyBuilder extends AbstractTopologyBuilder<LinkstateR
 
         private void unadvertized() {
             this.inab = new IgpNodeAttributesBuilder();
-            this.nb = new NodeBuilder().setKey(this.nb.getKey()).setNodeId(this.nb.getNodeId());
+            this.nb = new NodeBuilder().withKey(this.nb.key()).setNodeId(this.nb.getNodeId());
             this.advertized = false;
             LOG.debug("Node {} is unadvertized", this.nb.getNodeId());
         }
@@ -296,7 +296,7 @@ public class LinkstateTopologyBuilder extends AbstractTopologyBuilder<LinkstateR
 
     private static TerminationPoint buildTp(final TpId id, final TerminationPointType type) {
         final TerminationPointBuilder stpb = new TerminationPointBuilder();
-        stpb.setKey(new TerminationPointKey(id));
+        stpb.withKey(new TerminationPointKey(id));
         stpb.setTpId(id);
 
         if (type != null) {
@@ -389,7 +389,7 @@ public class LinkstateTopologyBuilder extends AbstractTopologyBuilder<LinkstateR
             final LinkstateRoute value, final LinkCase linkCase, final Attributes attributes) {
         // defensive lookup
         final LinkAttributes la;
-        final Attributes1 attr = attributes.getAugmentation(Attributes1.class);
+        final Attributes1 attr = attributes.augmentation(Attributes1.class);
         if (attr != null) {
             final LinkStateAttribute attrType = attr.getLinkStateAttribute();
             if (attrType != null) {
@@ -440,7 +440,7 @@ public class LinkstateTopologyBuilder extends AbstractTopologyBuilder<LinkstateR
         } else {
             snh.addTp(srcTp, lb.getLinkId(), false);
             final InstanceIdentifier<Node> nid = getNodeInstanceIdentifier(new NodeKey(snh.getNodeId()));
-            trans.put(LogicalDatastoreType.OPERATIONAL, nid.child(TerminationPoint.class, srcTp.getKey()), srcTp);
+            trans.put(LogicalDatastoreType.OPERATIONAL, nid.child(TerminationPoint.class, srcTp.key()), srcTp);
         }
 
         LOG.debug("Created TP {} as link destination", dstTp);
@@ -454,7 +454,7 @@ public class LinkstateTopologyBuilder extends AbstractTopologyBuilder<LinkstateR
             final InstanceIdentifier<Node> nid = getInstanceIdentifier().child(
                     org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network
                             .topology.topology.Node.class, new NodeKey(dnh.getNodeId()));
-            trans.put(LogicalDatastoreType.OPERATIONAL, nid.child(TerminationPoint.class, dstTp.getKey()), dstTp);
+            trans.put(LogicalDatastoreType.OPERATIONAL, nid.child(TerminationPoint.class, dstTp.key()), dstTp);
         }
 
         final InstanceIdentifier<Link> lid = buildLinkIdentifier(lb.getLinkId());
@@ -494,7 +494,7 @@ public class LinkstateTopologyBuilder extends AbstractTopologyBuilder<LinkstateR
             final LinkstateRoute value, final NodeCase nodeCase, final Attributes attributes) {
         final NodeAttributes na;
         //defensive lookup
-        final Attributes1 attr = attributes.getAugmentation(Attributes1.class);
+        final Attributes1 attr = attributes.augmentation(Attributes1.class);
         if (attr != null) {
             final LinkStateAttribute attrType = attr.getLinkStateAttribute();
             if (attrType != null) {
@@ -534,7 +534,7 @@ public class LinkstateTopologyBuilder extends AbstractTopologyBuilder<LinkstateR
          */
         final NodeBuilder nb = new NodeBuilder();
         nb.setNodeId(nid);
-        nb.setKey(new NodeKey(nb.getNodeId()));
+        nb.withKey(new NodeKey(nb.getNodeId()));
 
         nh.advertized(nb, inab);
         putNode(trans, nh);
@@ -560,12 +560,12 @@ public class LinkstateTopologyBuilder extends AbstractTopologyBuilder<LinkstateR
         }
         final PrefixBuilder pb = new PrefixBuilder();
         final PrefixKey pk = new PrefixKey(ippfx);
-        pb.setKey(pk);
+        pb.withKey(pk);
         pb.setPrefix(ippfx);
 
         final PrefixAttributes pa;
         // Very defensive lookup
-        final Attributes1 attr = attributes.getAugmentation(Attributes1.class);
+        final Attributes1 attr = attributes.augmentation(Attributes1.class);
         if (attr != null) {
             final LinkStateAttribute attrType = attr.getLinkStateAttribute();
             if (attrType != null) {
index 78ee0e4621e0cc941b7cdf0a895dbbfca4352f04..98fbf184d7973a86d26cbe164bfe125f5b38e2bd 100644 (file)
@@ -321,7 +321,7 @@ public final class ProtocolUtil {
         for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329
                 .UnreservedBandwidth bandwidth : input) {
             ret.add(new UnreservedBandwidthBuilder().setBandwidth(bandwidthToBigDecimal(bandwidth.getBandwidth()))
-                    .setKey(new UnreservedBandwidthKey(bandwidth.getPriority())).build());
+                    .withKey(new UnreservedBandwidthKey(bandwidth.getPriority())).build());
         }
 
         return ret;
index 36ab8c0382dd94f79bb2782e3eb817150f8060db..a6dcc65030aa4d092c48d0391f433dd4df2e0aa4 100644 (file)
@@ -74,7 +74,7 @@ abstract class AbstractBgpTopologyProvider implements BgpTopologyProvider, AutoC
 
     private TopologyReferenceSingletonService createInstance(final Topology topology) {
         final RibReference ribReference = new DefaultRibReference(InstanceIdentifier.create(BgpRib.class)
-                .child(Rib.class, new RibKey(topology.getAugmentation(Topology1.class).getRibId())));
+                .child(Rib.class, new RibKey(topology.augmentation(Topology1.class).getRibId())));
         final AbstractTopologyBuilder<?> topologyBuilder = createTopologyBuilder(this.dataBroker,
                 ribReference, topology.getTopologyId());
         return new TopologyReferenceSingletonServiceImpl(topologyBuilder, this.deployer, topology);
@@ -83,12 +83,12 @@ abstract class AbstractBgpTopologyProvider implements BgpTopologyProvider, AutoC
     abstract AbstractTopologyBuilder<?> createTopologyBuilder(DataBroker dataProvider, RibReference locRibReference,
             TopologyId topologyId);
 
-    final TopologyTypes1 getTopologyAug(final Topology topology) {
+    static final TopologyTypes1 getTopologyAug(final Topology topology) {
         final TopologyTypes topologyTypes = topology.getTopologyTypes();
         if (topologyTypes == null) {
             return null;
         }
 
-        return topologyTypes.getAugmentation(TopologyTypes1.class);
+        return topologyTypes.augmentation(TopologyTypes1.class);
     }
 }
index ccb65bb026748ee3ca77ac61f08af0261b681ec9..aaaa6385b6b1dd5c060119eee0b487eff52c9063 100755 (executable)
@@ -71,13 +71,13 @@ public class Ipv4ReachabilityTopologyBuilderTest extends AbstractTopologyBuilder
         updateIpv4Route(createIpv4Route(NEXT_HOP));
 
         readDataOperational(getDataBroker(), this.ipv4TopoBuilder.getInstanceIdentifier(), topology -> {
-            final TopologyTypes1 topologyTypes = topology.getTopologyTypes().getAugmentation(TopologyTypes1.class);
+            final TopologyTypes1 topologyTypes = topology.getTopologyTypes().augmentation(TopologyTypes1.class);
             assertNotNull(topologyTypes);
             assertNotNull(topologyTypes.getBgpIpv4ReachabilityTopology());
             assertEquals(1, topology.getNode().size());
             final Node node = topology.getNode().get(0);
             assertEquals(NEXT_HOP, node.getNodeId().getValue());
-            assertEquals(ROUTE_IP4PREFIX, node.getAugmentation(Node1.class).getIgpNodeAttributes().getPrefix().get(0)
+            assertEquals(ROUTE_IP4PREFIX, node.augmentation(Node1.class).getIgpNodeAttributes().getPrefix().get(0)
                 .getPrefix().getIpv4Prefix().getValue());
             return topology;
         });
@@ -88,7 +88,7 @@ public class Ipv4ReachabilityTopologyBuilderTest extends AbstractTopologyBuilder
             assertEquals(1, topology.getNode().size());
             final Node nodeUpdated = topology.getNode().get(0);
             assertEquals(NEW_NEXT_HOP, nodeUpdated.getNodeId().getValue());
-            assertEquals(ROUTE_IP4PREFIX, nodeUpdated.getAugmentation(Node1.class).getIgpNodeAttributes()
+            assertEquals(ROUTE_IP4PREFIX, nodeUpdated.augmentation(Node1.class).getIgpNodeAttributes()
                 .getPrefix().get(0).getPrefix().getIpv4Prefix().getValue());
             return topology;
         });
@@ -117,7 +117,7 @@ public class Ipv4ReachabilityTopologyBuilderTest extends AbstractTopologyBuilder
             .setOrigin(new OriginBuilder().setValue(BgpOrigin.Igp).build())
             .setCNextHop(new Ipv4NextHopCaseBuilder().setIpv4NextHop(new Ipv4NextHopBuilder()
                 .setGlobal(new Ipv4Address(nextHop)).build()).build()).build();
-        return new Ipv4RouteBuilder().setKey(new Ipv4RouteKey(new PathId(PATH_ID), ROUTE_IP4PREFIX))
+        return new Ipv4RouteBuilder().withKey(new Ipv4RouteKey(new PathId(PATH_ID), ROUTE_IP4PREFIX))
             .setPrefix(new Ipv4Prefix(ROUTE_IP4PREFIX)).setAttributes(attribute).build();
     }
 
index d604dcd70cdc4a9ae6c2b4d0c0f5c6b88409013a..a67a01c452ba186f5460782c373b6127d55d56f7 100755 (executable)
@@ -70,13 +70,13 @@ public class Ipv6ReachabilityTopologyBuilderTest extends AbstractTopologyBuilder
         updateIpv6Route(createIpv6Route(NEXT_HOP));
 
         readDataOperational(getDataBroker(), this.ipv6TopoBuilder.getInstanceIdentifier(), topology -> {
-            final TopologyTypes1 topologyType = topology.getTopologyTypes().getAugmentation(TopologyTypes1.class);
+            final TopologyTypes1 topologyType = topology.getTopologyTypes().augmentation(TopologyTypes1.class);
             assertNotNull(topologyType);
             assertNotNull(topologyType.getBgpIpv6ReachabilityTopology());
             assertEquals(1, topology.getNode().size());
             final Node node = topology.getNode().get(0);
             assertEquals(NEXT_HOP, node.getNodeId().getValue());
-            assertEquals(ROUTE_IP6PREFIX, node.getAugmentation(Node1.class).getIgpNodeAttributes().getPrefix()
+            assertEquals(ROUTE_IP6PREFIX, node.augmentation(Node1.class).getIgpNodeAttributes().getPrefix()
                 .get(0).getPrefix().getIpv6Prefix().getValue());
             return topology;
         });
@@ -88,7 +88,7 @@ public class Ipv6ReachabilityTopologyBuilderTest extends AbstractTopologyBuilder
             assertEquals(1, topology.getNode().size());
             final Node nodeUpdated = topology.getNode().get(0);
             assertEquals(NEW_NEXT_HOP, nodeUpdated.getNodeId().getValue());
-            assertEquals(ROUTE_IP6PREFIX, nodeUpdated.getAugmentation(Node1.class).getIgpNodeAttributes().getPrefix()
+            assertEquals(ROUTE_IP6PREFIX, nodeUpdated.augmentation(Node1.class).getIgpNodeAttributes().getPrefix()
                 .get(0).getPrefix().getIpv6Prefix().getValue());
             return topology;
         });
@@ -117,7 +117,7 @@ public class Ipv6ReachabilityTopologyBuilderTest extends AbstractTopologyBuilder
             .setOrigin(new OriginBuilder().setValue(BgpOrigin.Igp).build())
             .setCNextHop(new Ipv6NextHopCaseBuilder().setIpv6NextHop(
                 new Ipv6NextHopBuilder().setGlobal(new Ipv6Address(netxHop)).build()).build()).build();
-        return new Ipv6RouteBuilder().setKey(new Ipv6RouteKey(new PathId(PATH_ID), ROUTE_IP6PREFIX))
+        return new Ipv6RouteBuilder().withKey(new Ipv6RouteKey(new PathId(PATH_ID), ROUTE_IP6PREFIX))
             .setPrefix(new Ipv6Prefix(ROUTE_IP6PREFIX)).setAttributes(attribute).build();
     }
 }
index 2d6b1ec313a529fe6a59215e82ef015b47904fd7..2cbb3f5a0ce0bda8b21c85f761bf351f29c3e1f2 100755 (executable)
@@ -144,9 +144,9 @@ public class LinkstateTopologyBuilderTest extends AbstractTopologyBuilderTest {
     @Test
     public void testLinkstateTopologyBuilderTopologyTypes() throws ReadFailedException {
         readDataOperational(getDataBroker(), this.linkstateTopoBuilder.getInstanceIdentifier(), topology -> {
-            assertNotNull(topology.getTopologyTypes().getAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight
+            assertNotNull(topology.getTopologyTypes().augmentation(org.opendaylight.yang.gen.v1.urn.opendaylight
                     .params.xml.ns.yang.odl.bgp.topology.types.rev160524.TopologyTypes1.class));
-            assertNotNull(topology.getTopologyTypes().getAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight
+            assertNotNull(topology.getTopologyTypes().augmentation(org.opendaylight.yang.gen.v1.urn.opendaylight
                     .params.xml.ns.yang.odl.bgp.topology.types.rev160524.TopologyTypes1.class)
                     .getBgpLinkstateTopology());
             return topology;
@@ -161,17 +161,17 @@ public class LinkstateTopologyBuilderTest extends AbstractTopologyBuilderTest {
             assertEquals(1, topology.getNode().size());
             final Node node1 = topology.getNode().get(0);
             assertEquals(NODE_1_ISIS_ID, node1.getNodeId().getValue());
-            final IgpNodeAttributes igpNode1 = node1.getAugmentation(Node1.class).getIgpNodeAttributes();
+            final IgpNodeAttributes igpNode1 = node1.augmentation(Node1.class).getIgpNodeAttributes();
             assertEquals(ROUTER_1_ID, igpNode1.getRouterId().get(0).getIpv4Address().getValue());
             assertEquals("node1", igpNode1.getName().getValue());
-            final IgpNodeAttributes1 igpNodeAttributes1 = igpNode1.getAugmentation(IgpNodeAttributes1.class);
+            final IgpNodeAttributes1 igpNodeAttributes1 = igpNode1.augmentation(IgpNodeAttributes1.class);
             assertEquals("0000.0102.0304", igpNodeAttributes1.getIsisNodeAttributes().getIso().getIsoSystemId()
                     .getValue());
             assertEquals(ROUTER_1_ID, igpNodeAttributes1.getIsisNodeAttributes().getTed().getTeRouterIdIpv4()
                     .getValue());
             assertEquals("47.0000.0000.0000.0000.0102.0304", igpNodeAttributes1.getIsisNodeAttributes()
                     .getNet().get(0).getValue());
-            assertNull(igpNode1.getAugmentation(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.ospf
+            assertNull(igpNode1.augmentation(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.ospf
                     .topology.rev131021.IgpNodeAttributes1.class));
             return topology;
         });
@@ -189,11 +189,11 @@ public class LinkstateTopologyBuilderTest extends AbstractTopologyBuilderTest {
                     + "=2&mt=1", link1.getLinkId().getValue());
             assertEquals(NODE_1_ISIS_ID, link1.getSource().getSourceNode().getValue());
             assertEquals(NODE_2_ISIS_ID, link1.getDestination().getDestNode().getValue());
-            final IgpLinkAttributes igpLink1 = link1.getAugmentation(Link1.class).getIgpLinkAttributes();
+            final IgpLinkAttributes igpLink1 = link1.augmentation(Link1.class).getIgpLinkAttributes();
             assertEquals("link1", igpLink1.getName());
-            assertEquals((short) 1, igpLink1.getAugmentation(IgpLinkAttributes1.class).getIsisLinkAttributes()
+            assertEquals((short) 1, igpLink1.augmentation(IgpLinkAttributes1.class).getIsisLinkAttributes()
                     .getMultiTopologyId().shortValue());
-            assertNull(igpLink1.getAugmentation(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.ospf
+            assertNull(igpLink1.augmentation(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.ospf
                     .topology.rev131021.IgpLinkAttributes1.class));
             return topology;
         });
@@ -204,7 +204,7 @@ public class LinkstateTopologyBuilderTest extends AbstractTopologyBuilderTest {
                 NODE_1_AS, ROUTER_2_ID));
         readDataOperational(getDataBroker(), this.linkstateTopoBuilder.getInstanceIdentifier(), topology -> {
             assertEquals(1, topology.getNode().size());
-            final IgpNodeAttributes igpNode2 = topology.getNode().get(0).getAugmentation(Node1.class)
+            final IgpNodeAttributes igpNode2 = topology.getNode().get(0).augmentation(Node1.class)
                     .getIgpNodeAttributes();
             assertEquals(ROUTER_2_ID, igpNode2.getRouterId().get(0).getIpv4Address().getValue());
             assertEquals("updated-node", igpNode2.getName().getValue());
@@ -230,11 +230,11 @@ public class LinkstateTopologyBuilderTest extends AbstractTopologyBuilderTest {
             assertEquals(1, topology.getNode().size());
             final Node node1 = topology.getNode().get(0);
             assertEquals(NODE_1_OSPF_ID, node1.getNodeId().getValue());
-            final IgpNodeAttributes igpNode1 = node1.getAugmentation(Node1.class).getIgpNodeAttributes();
+            final IgpNodeAttributes igpNode1 = node1.augmentation(Node1.class).getIgpNodeAttributes();
             assertEquals(ROUTER_1_ID, igpNode1.getRouterId().get(0).getIpv4Address().getValue());
             assertEquals("node1", igpNode1.getName().getValue());
-            assertNull(igpNode1.getAugmentation(IgpNodeAttributes1.class));
-            assertEquals(ROUTER_1_ID, igpNode1.getAugmentation(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns
+            assertNull(igpNode1.augmentation(IgpNodeAttributes1.class));
+            assertEquals(ROUTER_1_ID, igpNode1.augmentation(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns
                     .yang.ospf.topology.rev131021.IgpNodeAttributes1.class).getOspfNodeAttributes().getTed()
                     .getTeRouterIdIpv4().getValue());
             return topology;
@@ -244,8 +244,8 @@ public class LinkstateTopologyBuilderTest extends AbstractTopologyBuilderTest {
         updateLinkstateRoute(createLinkstatePrefixRoute(ProtocolId.Ospf, NODE_1_AS, NODE_1_PREFIX,
                 500L, ROUTER_1_ID));
         readDataOperational(getDataBroker(), this.linkstateTopoBuilder.getInstanceIdentifier(), topology -> {
-            final IgpNodeAttributes igpNode2 = topology.getNode().get(0)
-                    .getAugmentation(Node1.class).getIgpNodeAttributes();
+            final IgpNodeAttributes igpNode2 = topology.getNode().get(0).augmentation(Node1.class)
+                    .getIgpNodeAttributes();
             assertEquals(1, igpNode2.getPrefix().size());
             final Prefix prefix = igpNode2.getPrefix().get(0);
             assertEquals(NODE_1_PREFIX, prefix.getPrefix().getIpv4Prefix().getValue());
@@ -266,13 +266,13 @@ public class LinkstateTopologyBuilderTest extends AbstractTopologyBuilderTest {
                     link1.getLinkId().getValue());
             assertEquals(NODE_1_OSPF_ID, link1.getSource().getSourceNode().getValue());
             assertEquals(NODE_2_OSPF_ID, link1.getDestination().getDestNode().getValue());
-            final IgpLinkAttributes igpLink1 = link1.getAugmentation(Link1.class).getIgpLinkAttributes();
+            final IgpLinkAttributes igpLink1 = link1.augmentation(Link1.class).getIgpLinkAttributes();
             assertEquals("link1", igpLink1.getName());
-            assertNull(igpLink1.getAugmentation(IgpLinkAttributes1.class));
-            assertEquals((short) 1, igpLink1.getAugmentation(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang
+            assertNull(igpLink1.augmentation(IgpLinkAttributes1.class));
+            assertEquals((short) 1, igpLink1.augmentation(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang
                     .ospf.topology.rev131021.IgpLinkAttributes1.class).getOspfLinkAttributes().getMultiTopologyId()
                     .shortValue());
-            assertEquals(2, igpLink1.getAugmentation(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns
+            assertEquals(2, igpLink1.augmentation(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns
                     .yang.ospf.topology.rev131021.IgpLinkAttributes1.class).getOspfLinkAttributes().getTed().getSrlg()
                     .getSrlgValues().size());
             return topology;
@@ -425,7 +425,7 @@ public class LinkstateTopologyBuilderTest extends AbstractTopologyBuilderTest {
                                         .setMaxReservableBandwidth(
                                                 new Bandwidth(new byte[]{0x00, 0x00, (byte) 0xff, (byte) 0x1f}))
                                         .setUnreservedBandwidth(Lists.newArrayList(new UnreservedBandwidthBuilder()
-                                                .setKey(new UnreservedBandwidthKey((short) 1))
+                                                .withKey(new UnreservedBandwidthKey((short) 1))
                                                 .setBandwidth(new Bandwidth(new byte[]{0x00, 0x00, 0x00, (byte) 0xff}))
                                                 .build()))
                                         .setTeMetric(new TeMetric(100L)).setLinkName(linkName).build()).build())
@@ -437,7 +437,7 @@ public class LinkstateTopologyBuilderTest extends AbstractTopologyBuilderTest {
     private static LinkstateRouteBuilder createBaseBuilder(final ProtocolId protocolId) {
         return new LinkstateRouteBuilder()
             .setIdentifier(IDENTIFIER)
-            .setKey(new LinkstateRouteKey(new PathId(0L), LINKSTATE_ROUTE_KEY))
+            .withKey(new LinkstateRouteKey(new PathId(0L), LINKSTATE_ROUTE_KEY))
             .setRouteKey(LINKSTATE_ROUTE_KEY)
             .setProtocolId(protocolId);
     }
index a9af303ba62015718affb6848582ef71a7fb0f05..e7b13de23508f8e26d422570cd61eca57c47cfb8 100644 (file)
@@ -103,8 +103,8 @@ final class BmpRibInWriter {
             MpReachNlri mpReach = null;
             if (message.getNlri() != null) {
                 mpReach = prefixesToMpReach(message);
-            } else if (attrs != null && attrs.getAugmentation(Attributes1.class) != null) {
-                mpReach = attrs.getAugmentation(Attributes1.class).getMpReachNlri();
+            } else if (attrs != null && attrs.augmentation(Attributes1.class) != null) {
+                mpReach = attrs.augmentation(Attributes1.class).getMpReachNlri();
             }
             if (mpReach != null) {
                 addRoutes(mpReach, attrs);
@@ -114,8 +114,8 @@ final class BmpRibInWriter {
             MpUnreachNlri mpUnreach = null;
             if (message.getWithdrawnRoutes() != null) {
                 mpUnreach = prefixesToMpUnreach(message);
-            } else if (attrs != null && attrs.getAugmentation(Attributes2.class) != null) {
-                mpUnreach = attrs.getAugmentation(Attributes2.class).getMpUnreachNlri();
+            } else if (attrs != null && attrs.augmentation(Attributes2.class) != null) {
+                mpUnreach = attrs.augmentation(Attributes2.class).getMpUnreachNlri();
             }
             if (mpUnreach != null) {
                 removeRoutes(mpUnreach);
@@ -253,13 +253,13 @@ final class BmpRibInWriter {
         boolean isEOR = false;
         if (msg.getNlri() == null && msg.getWithdrawnRoutes() == null) {
             if (msg.getAttributes() != null) {
-                if (msg.getAttributes().getAugmentation(Attributes1.class) != null) {
-                    final Attributes1 pa = msg.getAttributes().getAugmentation(Attributes1.class);
+                if (msg.getAttributes().augmentation(Attributes1.class) != null) {
+                    final Attributes1 pa = msg.getAttributes().augmentation(Attributes1.class);
                     if (pa.getMpReachNlri() != null) {
                         type = new TablesKey(pa.getMpReachNlri().getAfi(), pa.getMpReachNlri().getSafi());
                     }
-                } else if (msg.getAttributes().getAugmentation(Attributes2.class) != null) {
-                    final Attributes2 pa = msg.getAttributes().getAugmentation(Attributes2.class);
+                } else if (msg.getAttributes().augmentation(Attributes2.class) != null) {
+                    final Attributes2 pa = msg.getAttributes().augmentation(Attributes2.class);
                     if (pa.getMpUnreachNlri() != null) {
                         type = new TablesKey(pa.getMpUnreachNlri().getAfi(), pa.getMpUnreachNlri().getSafi());
                     }
index 327d6e5ef4932660899b40012e842afec75e8d92..855f36e5e60e8db30901964d2d05f1ad478bb626 100644 (file)
@@ -264,11 +264,11 @@ public final class BmpRouterPeerImpl implements BmpRouterPeer {
         for (final BgpParameters param : open.getBgpParameters()) {
             for (final OptionalCapabilities optCapa : param.getOptionalCapabilities()) {
                 final CParameters cParam = optCapa.getCParameters();
-                if (cParam.getAugmentation(CParameters1.class) == null
-                        || cParam.getAugmentation(CParameters1.class).getMultiprotocolCapability() == null) {
+                if (cParam.augmentation(CParameters1.class) == null
+                        || cParam.augmentation(CParameters1.class).getMultiprotocolCapability() == null) {
                     continue;
                 }
-                final MultiprotocolCapability multi = cParam.getAugmentation(CParameters1.class)
+                final MultiprotocolCapability multi = cParam.augmentation(CParameters1.class)
                         .getMultiprotocolCapability();
                 final TablesKey tt = new TablesKey(multi.getAfi(), multi.getSafi());
                 tables.add(tt);
index cdd78b906e67377c2488824e78487c11650589e9..53d32b6e0404d0597dbe1525fd2bf3134d88ffa9 100644 (file)
@@ -60,7 +60,7 @@ public final class BmpMonitorConfigFileProcessor implements ConfigFileProcessor,
 
     private static void processBmpMonitorConfig(final BmpMonitorConfig bmpConfig, final WriteTransaction wtx) {
         final KeyedInstanceIdentifier<BmpMonitorConfig, BmpMonitorConfigKey> iid = ODL_BMP_MONITORS_IID
-                .child(BmpMonitorConfig.class, bmpConfig.getKey());
+                .child(BmpMonitorConfig.class, bmpConfig.key());
 
         wtx.merge(LogicalDatastoreType.CONFIGURATION, iid, bmpConfig, true);
     }
index 0183068041e043ca897c69ae05399a9086cf6c56..926c6890ae0717a726c5ffa6b37f1eccbe5fa9a7 100644 (file)
@@ -65,7 +65,7 @@ public final class ProtocolsConfigFileProcessor implements ConfigFileProcessor,
 
     private static void processProtocol(final Protocol protocol, final WriteTransaction wtx) {
         final KeyedInstanceIdentifier<Protocol, ProtocolKey> topologyIIdKeyed =
-                BGP_PROTOCOLS_IID.child(Protocol.class, protocol.getKey());
+                BGP_PROTOCOLS_IID.child(Protocol.class, protocol.key());
         wtx.merge(LogicalDatastoreType.CONFIGURATION, topologyIIdKeyed, protocol, true);
     }
 
index 6074009ee464d4d7ec95dbf252b43bff32039125..b4ac8f44f484b27c47738a7435a95e4221ecb740 100644 (file)
@@ -104,7 +104,7 @@ public final class NetworkTopologyConfigFileProcessor implements ConfigFileProce
     private static void processTopology(final Topology topology, final WriteTransaction wtx) {
         LOG.info("Storing Topology {}", topology);
         final KeyedInstanceIdentifier<Topology, TopologyKey> topologyIIdKeyed =
-                InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, topology.getKey());
+                InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, topology.key());
         wtx.merge(LogicalDatastoreType.CONFIGURATION, topologyIIdKeyed, topology, true);
     }
 }
index 6a7a64b0d2584dd0277a35775155afe82fb0bdb6..2e264b89122bd6c0f5b2e277ab200197fcff6f3b 100644 (file)
@@ -59,7 +59,7 @@ public class PcRptMessageCodec extends Stateful07PCReportMessageParser {
     protected void serializeObject(final Object object, final ByteBuf buffer) {
         super.serializeObject(object, buffer);
         if (object instanceof Bandwidth) {
-            final Bandwidth1 bw = ((Bandwidth) object).getAugmentation(Bandwidth1.class);
+            final Bandwidth1 bw = ((Bandwidth) object).augmentation(Bandwidth1.class);
             if (bw != null) {
                 super.serializeObject(new BandwidthUsageBuilder().setBwSample(bw.getBwSample()).build(), buffer);
             }
index c1fd8963d011baacee57dd01b32d4346b4910fdf..39501084c3fb133af46e500eb42fd68b12260920 100644 (file)
@@ -97,7 +97,7 @@ public class PcRptMessageCodecTest {
         final Ero ero = new EroBuilder().build();
         final List<Object> objects = Lists.newArrayList(lsp, ero, bw);
         final Reports validReports = codec.getValidReports(objects, Collections.emptyList());
-        assertNotNull(validReports.getPath().getBandwidth().getAugmentation(Bandwidth1.class));
+        assertNotNull(validReports.getPath().getBandwidth().augmentation(Bandwidth1.class));
         assertTrue(objects.isEmpty());
     }
 
@@ -136,7 +136,7 @@ public class PcRptMessageCodecTest {
         final Pcrpt msg = (Pcrpt) this.ctx.getMessageHandlerRegistry().parseMessage(10,
                 Unpooled.wrappedBuffer(parseHexBinary), Collections.emptyList());
         Assert.assertNotNull(msg.getPcrptMessage().getReports().get(0).getPath()
-                .getBandwidth().getAugmentation(Bandwidth1.class));
+                .getBandwidth().augmentation(Bandwidth1.class));
     }
 
 }
index fd63e28db89c7ba91696580837f5c4122fb768ae..aa476b0ef33d7a3004d278eaf986c8e0e6c318c0 100644 (file)
@@ -51,8 +51,8 @@ public class CInitiated00LspObjectParser extends Stateful07LspObjectParser {
         flags.set(REMOVE, specObj.isRemove());
         flags.set(SYNC, specObj.isSync());
         flags.set(ADMINISTRATIVE, specObj.isAdministrative());
-        if (specObj.getAugmentation(Lsp1.class) != null) {
-            flags.set(CREATE_FLAG_OFFSET, specObj.getAugmentation(Lsp1.class).isCreate());
+        if (specObj.augmentation(Lsp1.class) != null) {
+            flags.set(CREATE_FLAG_OFFSET, specObj.augmentation(Lsp1.class).isCreate());
         }
         return flags;
     }
index 5afe1e385750dd284b48377cabcaef341d1af6cf..3b5675644dbe1d223d485323d6100d6f9a4e7dff 100644 (file)
@@ -37,8 +37,8 @@ public class CInitiated00SrpObjectParser extends Stateful07SrpObjectParser {
     @Override
     protected void serializeFlags(final Srp srp, final ByteBuf body) {
         final BitArray flags = new BitArray(FLAGS_SIZE);
-        if (srp.getAugmentation(Srp1.class) != null) {
-            flags.set(REMOVE_FLAG, srp.getAugmentation(Srp1.class).isRemove());
+        if (srp.augmentation(Srp1.class) != null) {
+            flags.set(REMOVE_FLAG, srp.augmentation(Srp1.class).isRemove());
         }
         flags.toByteBuf(body);
     }
index f3c1c8e984f73621633c437de3f70b71fd2b7bd5..408be5455871412559cf15b611af3433f524c787 100644 (file)
@@ -34,7 +34,7 @@ public class CInitiated00StatefulCapabilityTlvParser extends Stateful07StatefulC
     @Override
     protected BitArray serializeFlags(final Stateful sct) {
         final BitArray flags = new BitArray(FLAGS_F_LENGTH);
-        final Stateful1 sfi = sct.getAugmentation(Stateful1.class);
+        final Stateful1 sfi = sct.augmentation(Stateful1.class);
         if (sfi != null) {
             flags.set(I_FLAG_OFFSET, sfi.isInitiation());
         }
index ca53010b8b6d64ecf6f8aed5962928f3c401f753..fd8af263b6aead523e55250bf072fa24c3841286 100644 (file)
@@ -31,8 +31,8 @@ public class Stateful07LspaObjectParser extends PCEPLspaObjectParser {
     public void addTlv(final TlvsBuilder tbuilder, final Tlv tlv) {
         super.addTlv(tbuilder, tlv);
         final Tlvs2Builder nameBuilder = new Tlvs2Builder();
-        if (tbuilder.getAugmentation(Tlvs2.class) != null) {
-            final Tlvs2 t = tbuilder.getAugmentation(Tlvs2.class);
+        if (tbuilder.augmentation(Tlvs2.class) != null) {
+            final Tlvs2 t = tbuilder.augmentation(Tlvs2.class);
             if (t.getSymbolicPathName() != null) {
                 nameBuilder.setSymbolicPathName(t.getSymbolicPathName());
             }
@@ -49,8 +49,8 @@ public class Stateful07LspaObjectParser extends PCEPLspaObjectParser {
             return;
         }
         super.serializeTlvs(tlvs, body);
-        if (tlvs.getAugmentation(Tlvs2.class) != null) {
-            final Tlvs2 nameTlvs = tlvs.getAugmentation(Tlvs2.class);
+        if (tlvs.augmentation(Tlvs2.class) != null) {
+            final Tlvs2 nameTlvs = tlvs.augmentation(Tlvs2.class);
             if (nameTlvs.getSymbolicPathName() != null) {
                 serializeTlv(nameTlvs.getSymbolicPathName(), body);
             }
index bfbaf19f85fda58064b107163c9c96f4dc93573f..ec9608f20262e3017aa92f5cf45646a7e7bc0330 100644 (file)
@@ -31,8 +31,8 @@ public class Stateful07OpenObjectParser extends PCEPOpenObjectParser {
     public void addTlv(final TlvsBuilder tbuilder, final Tlv tlv) {
         super.addTlv(tbuilder, tlv);
         final Tlvs1Builder statefulBuilder = new Tlvs1Builder();
-        if (tbuilder.getAugmentation(Tlvs1.class) != null) {
-            final Tlvs1 t = tbuilder.getAugmentation(Tlvs1.class);
+        if (tbuilder.augmentation(Tlvs1.class) != null) {
+            final Tlvs1 t = tbuilder.augmentation(Tlvs1.class);
             if (t.getStateful() != null) {
                 statefulBuilder.setStateful(t.getStateful());
             }
@@ -52,8 +52,8 @@ public class Stateful07OpenObjectParser extends PCEPOpenObjectParser {
         if (tlvs.getOfList() != null) {
             serializeTlv(tlvs.getOfList(), body);
         }
-        if (tlvs.getAugmentation(Tlvs1.class) != null) {
-            final Tlvs1 statefulTlvs = tlvs.getAugmentation(Tlvs1.class);
+        if (tlvs.augmentation(Tlvs1.class) != null) {
+            final Tlvs1 statefulTlvs = tlvs.augmentation(Tlvs1.class);
             if (statefulTlvs.getStateful() != null) {
                 serializeTlv(statefulTlvs.getStateful(), body);
             }
index d60baf4a8c97c6a8aae365e3fabd4ed1ba0051e8..1600b231279045bf1a5404511843987a43b064e2 100644 (file)
@@ -48,8 +48,8 @@ public class SyncOptimizationsCapabilityTlvParser extends CInitiated00StatefulCa
     @Override
     protected BitArray serializeFlags(final Stateful sct) {
         final BitArray flags = new BitArray(FLAGS_F_LENGTH);
-        final Stateful1 sfi = sct.getAugmentation(Stateful1.class);
-        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev171025.Stateful1 sf2 = sct.getAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev171025.Stateful1.class);
+        final Stateful1 sfi = sct.augmentation(Stateful1.class);
+        final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev171025.Stateful1 sf2 = sct.augmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev171025.Stateful1.class);
         if (sf2 != null) {
             flags.set(F_FLAG_OFFSET, sf2.isTriggeredInitialSync());
             flags.set(D_FLAG_OFFSET, sf2.isDeltaLspSyncCapability());
index 6e3f0cbf202272ebe77fef207da5fc7ae2f7e227..1538c5217a4a2f10c8b9415f710903d53b141026 100644 (file)
@@ -28,7 +28,7 @@ public class SyncOptimizationsLspObjectParser extends CInitiated00LspObjectParse
     public void serializeTlvs(final Tlvs tlvs, final ByteBuf body) {
         if (tlvs != null) {
             super.serializeTlvs(tlvs, body);
-            serializeAugmentation(tlvs.getAugmentation(Tlvs1.class), body);
+            serializeAugmentation(tlvs.augmentation(Tlvs1.class), body);
         }
     }
 
@@ -42,8 +42,8 @@ public class SyncOptimizationsLspObjectParser extends CInitiated00LspObjectParse
     public void addTlv(final TlvsBuilder tbuilder, final Tlv tlv) {
         super.addTlv(tbuilder, tlv);
         final Tlvs1Builder syncOptTlvsBuilder = new Tlvs1Builder();
-        if (tbuilder.getAugmentation(Tlvs1.class) != null) {
-            final Tlvs1 t = tbuilder.getAugmentation(Tlvs1.class);
+        if (tbuilder.augmentation(Tlvs1.class) != null) {
+            final Tlvs1 t = tbuilder.augmentation(Tlvs1.class);
             if (t.getLspDbVersion() != null) {
                 syncOptTlvsBuilder.setLspDbVersion(t.getLspDbVersion());
             }
index 76c4fe4ed848aedb94ccaeb18917c70b4102034c..0faeb75a473726840a4b4111bead2f69e6a884ad 100644 (file)
@@ -30,8 +30,8 @@ public class SyncOptimizationsOpenObjectParser extends Stateful07OpenObjectParse
     public void addTlv(final TlvsBuilder tbuilder, final Tlv tlv) {
         super.addTlv(tbuilder, tlv);
         final Tlvs3Builder syncOptTlvsBuilder = new Tlvs3Builder();
-        if (tbuilder.getAugmentation(Tlvs3.class) != null) {
-            final Tlvs3 t = tbuilder.getAugmentation(Tlvs3.class);
+        if (tbuilder.augmentation(Tlvs3.class) != null) {
+            final Tlvs3 t = tbuilder.augmentation(Tlvs3.class);
             if (t.getLspDbVersion() != null) {
                 syncOptTlvsBuilder.setLspDbVersion(t.getLspDbVersion());
             }
@@ -54,8 +54,8 @@ public class SyncOptimizationsOpenObjectParser extends Stateful07OpenObjectParse
             return;
         }
         super.serializeTlvs(tlvs, body);
-        if (tlvs.getAugmentation(Tlvs3.class) != null) {
-            final Tlvs3 syncOptTlvs = tlvs.getAugmentation(Tlvs3.class);
+        if (tlvs.augmentation(Tlvs3.class) != null) {
+            final Tlvs3 syncOptTlvs = tlvs.augmentation(Tlvs3.class);
             if (syncOptTlvs.getLspDbVersion() != null) {
                 serializeTlv(syncOptTlvs.getLspDbVersion(), body);
             }
index 9cf3f990b59d56e43c59d37d98aeeed744debd0c..65458299ff8c7d20a12ac7b446cbb9ef834778dc 100644 (file)
@@ -234,7 +234,7 @@ public class PCEPObjectParserTest {
 
         // Tlvs container does not contain toString
         final Object o = parser.parseObject(new ObjectHeaderImpl(true, true), result.slice(4, result.readableBytes() - 4));
-        assertEquals(tlv, ((Lspa) o).getTlvs().getAugmentation(Tlvs2.class).getSymbolicPathName());
+        assertEquals(tlv, ((Lspa) o).getTlvs().augmentation(Tlvs2.class).getSymbolicPathName());
         // assertEquals(builder.build(), parser.parseObject(new ObjectHeaderImpl(true, true), ByteArray.cutBytes(result,
         // 4)));
         final ByteBuf buf = Unpooled.buffer();
index 03aaa4d0af64b50b824677c3a1c4a7feb457d295..e28aa61cddd3b473c38d96c50d18117e1cffa15a 100644 (file)
@@ -81,7 +81,7 @@ final class PCCSyncOptimization {
 
     private static LspDbVersion getLspDbVersion(final Tlvs openTlvs) {
         if (openTlvs != null) {
-            final Tlvs3 tlvs3 = openTlvs.getAugmentation(Tlvs3.class);
+            final Tlvs3 tlvs3 = openTlvs.augmentation(Tlvs3.class);
             if (tlvs3 != null && tlvs3.getLspDbVersion() != null
                 && tlvs3.getLspDbVersion().getLspDbVersionValue() != null) {
                 return tlvs3.getLspDbVersion();
@@ -99,9 +99,9 @@ final class PCCSyncOptimization {
 
     private static Stateful1 getStateful1(final Tlvs openTlvs) {
         if (openTlvs != null) {
-            final Tlvs1 tlvs1 = openTlvs.getAugmentation(Tlvs1.class);
+            final Tlvs1 tlvs1 = openTlvs.augmentation(Tlvs1.class);
             if (tlvs1 != null && tlvs1.getStateful() != null) {
-                return tlvs1.getStateful().getAugmentation(Stateful1.class);
+                return tlvs1.getStateful().augmentation(Stateful1.class);
             }
         }
         return null;
index 35b2a2a6980f78751a898c173d542adb661e4984..e9e80cc7a40222a46760b0902c969efa03b3e5e5 100644 (file)
@@ -250,8 +250,8 @@ public final class PCCTunnelManagerImpl implements PCCTunnelManager {
 
     @Override
     public void onMessagePcInitiate(@Nonnull final Requests request, @Nonnull final PCCSession session) {
-        if ((request.getSrp().getAugmentation(Srp1.class) != null)
-                && request.getSrp().getAugmentation(Srp1.class).isRemove()) {
+        if ((request.getSrp().augmentation(Srp1.class) != null)
+                && request.getSrp().augmentation(Srp1.class).isRemove()) {
             //remove LSP
             removeTunnel(request, session);
         } else if ((request.getLsp().isDelegate() != null) && request.getLsp().isDelegate()
index f8773474fc0aa708a01dd8a2555031b3de396ec7..e447efd624b66670f27e4dc557d9237c8c66e0b4 100644 (file)
@@ -148,9 +148,9 @@ public abstract class PCCMockCommon {
         final PCEPSession session = pceSessionListener.getSession();
         checkSession(session, DEAD_TIMER, KEEP_ALIVE);
 
-        assertTrue(session.getRemoteTlvs().getAugmentation(Tlvs1.class).getStateful()
-                .getAugmentation(Stateful1.class).isInitiation());
-        assertNull(session.getLocalTlvs().getAugmentation(Tlvs3.class)
+        assertTrue(session.getRemoteTlvs().augmentation(Tlvs1.class).getStateful()
+                .augmentation(Stateful1.class).isInitiation());
+        assertNull(session.getLocalTlvs().augmentation(Tlvs3.class)
                 .getLspDbVersion().getLspDbVersionValue());
     }
 
@@ -173,9 +173,9 @@ public abstract class PCCMockCommon {
 
         checkSession(session, DEAD_TIMER, KEEP_ALIVE);
 
-        assertTrue(session.getRemoteTlvs().getAugmentation(Tlvs1.class).getStateful()
-                .getAugmentation(Stateful1.class).isInitiation());
-        final BigInteger pceDBVersion = session.getLocalTlvs().getAugmentation(Tlvs3.class)
+        assertTrue(session.getRemoteTlvs().augmentation(Tlvs1.class).getStateful()
+                .augmentation(Stateful1.class).isInitiation());
+        final BigInteger pceDBVersion = session.getLocalTlvs().augmentation(Tlvs3.class)
                 .getLspDbVersion().getLspDbVersionValue();
         assertEquals(startingDBVersion, pceDBVersion);
     }
@@ -185,8 +185,8 @@ public abstract class PCCMockCommon {
         assertNotNull(session);
         assertEquals(expectedDeadTimer, session.getPeerPref().getDeadtimer().shortValue());
         assertEquals(expectedKeepAlive, session.getPeerPref().getKeepalive().shortValue());
-        final Stateful1 stateful = session.getRemoteTlvs().getAugmentation(Tlvs1.class)
-                .getStateful().getAugmentation(Stateful1.class);
+        final Stateful1 stateful = session.getRemoteTlvs().augmentation(Tlvs1.class)
+                .getStateful().augmentation(Stateful1.class);
         assertTrue(stateful.isInitiation());
     }
 
@@ -201,7 +201,7 @@ public abstract class PCCMockCommon {
                 } else {
                     assertEquals(true, lsp.isSync());
                 }
-                final BigInteger actuaLspDBVersion = lsp.getTlvs().getAugmentation(org.opendaylight.yang.gen
+                final BigInteger actuaLspDBVersion = lsp.getTlvs().augmentation(org.opendaylight.yang.gen
                     .v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.sync.optimizations.rev171025.Tlvs1.class)
                     .getLspDbVersion().getLspDbVersionValue();
                 assertEquals(expectedDbVersion, actuaLspDBVersion);
index 32d092af7352d4a8cf7db4b8bc11d9967f14266d..2e549e45919a6c2ce3d2d9bef4f1c34ccf12993c 100644 (file)
@@ -28,8 +28,8 @@ public class PcepOpenObjectWithSpcTlvParser extends SyncOptimizationsOpenObjectP
     public void addTlv(final TlvsBuilder tbuilder, final Tlv tlv) {
         super.addTlv(tbuilder, tlv);
         final Tlvs1Builder tlvBuilder = new Tlvs1Builder();
-        if (tbuilder.getAugmentation(Tlvs1.class) != null) {
-            final Tlvs1 tlvs = tbuilder.getAugmentation(Tlvs1.class);
+        if (tbuilder.augmentation(Tlvs1.class) != null) {
+            final Tlvs1 tlvs = tbuilder.augmentation(Tlvs1.class);
             if (tlvs.getSrPceCapability() != null) {
                 tlvBuilder.setSrPceCapability(tlvs.getSrPceCapability());
             }
@@ -46,8 +46,8 @@ public class PcepOpenObjectWithSpcTlvParser extends SyncOptimizationsOpenObjectP
             return;
         }
         super.serializeTlvs(tlvs, body);
-        if (tlvs.getAugmentation(Tlvs1.class) != null) {
-            final Tlvs1 spcTlvs = tlvs.getAugmentation(Tlvs1.class);
+        if (tlvs.augmentation(Tlvs1.class) != null) {
+            final Tlvs1 spcTlvs = tlvs.augmentation(Tlvs1.class);
             if (spcTlvs.getSrPceCapability() != null) {
                 serializeTlv(spcTlvs.getSrPceCapability(), body);
             }
index efc413f66c13d850a5d51d1e9e2e9ab0b8e5e604..f94fa4ef1275ac2cd23bad7e473125d5c3c5a1de 100644 (file)
@@ -78,7 +78,7 @@ public class TopologyProviderTest extends AbstractPCEPSessionTest<Stateful07Topo
             assertEquals(1, reportedLsps.size());
             final ReportedLsp lsp = reportedLsps.get(0);
             assertEquals("sr-path1", lsp.getName());
-            assertEquals(1, lsp.getPath().get(0).getAugmentation(Path1.class).getPathSetupType()
+            assertEquals(1, lsp.getPath().get(0).augmentation(Path1.class).getPathSetupType()
                 .getPst().intValue());
             final List<Subobject> subobjects = lsp.getPath().get(0).getEro().getSubobject();
             assertEquals(1, subobjects.size());
index 5a12ae60f71a891a73c4dc4980f894ca6dcaa5bd..453dfde674816d328f34306984d04d9f69ab93a4 100644 (file)
@@ -67,7 +67,7 @@ public final class PcepStateUtils {
             stream.println(String.format("Node [%s] not found", nodeId));
             return;
         }
-        final PcepTopologyNodeStatsAug state = node.getAugmentation(PcepTopologyNodeStatsAug.class);
+        final PcepTopologyNodeStatsAug state = node.augmentation(PcepTopologyNodeStatsAug.class);
         if (state == null) {
             stream.println(String.format("State not found for [%s]", nodeId));
             return;
@@ -90,7 +90,7 @@ public final class PcepStateUtils {
         addHeader(table, "Local preferences");
         final LocalPref localPref = pcepSessionState.getLocalPref();
         showPreferences(table, localPref);
-        final PcepEntityIdStatsAug entAug = localPref.getAugmentation(PcepEntityIdStatsAug.class);
+        final PcepEntityIdStatsAug entAug = localPref.augmentation(PcepEntityIdStatsAug.class);
         if (entAug != null) {
             table.addRow().addContent("Speaker Entity Identifier",
                     Arrays.toString(entAug.getSpeakerEntityIdValue()));
@@ -128,7 +128,7 @@ public final class PcepStateUtils {
         if (capa == null) {
             return;
         }
-        final StatefulCapabilitiesStatsAug stateFulCapa = capa.getAugmentation(StatefulCapabilitiesStatsAug.class);
+        final StatefulCapabilitiesStatsAug stateFulCapa = capa.augmentation(StatefulCapabilitiesStatsAug.class);
         if (stateFulCapa != null) {
             addHeader(table, "Stateful Capabilities");
             table.addRow().addContent("Stateful", stateFulCapa.isStateful());
@@ -148,7 +148,7 @@ public final class PcepStateUtils {
         table.addRow().addContent("Sent Msg Count", messages.getSentMsgCount());
         table.addRow().addContent("Unknown Msg Received", messages.getUnknownMsgReceived());
 
-        final StatefulMessagesStatsAug statefulMessages = messages.getAugmentation(StatefulMessagesStatsAug.class);
+        final StatefulMessagesStatsAug statefulMessages = messages.augmentation(StatefulMessagesStatsAug.class);
         if (statefulMessages == null) {
             return;
         }
index e6529e8368e0cce2c96b8f50fb9aa1d211f16109..2429c591a2f8ba9d593d85bff718e3dd11378414 100755 (executable)
@@ -165,7 +165,7 @@ public abstract class AbstractTopologySessionListener<S, L> implements TopologyS
         final boolean isNodePresent = isLspDbRetreived() && initialNodeState != null;
         if (isNodePresent) {
             loadLspData(initialNodeState, this.lspData, this.lsps, isIncrementalSynchro());
-            pccBuilder.setReportedLsp(initialNodeState.getAugmentation(Node1.class)
+            pccBuilder.setReportedLsp(initialNodeState.augmentation(Node1.class)
                     .getPathComputationClient().getReportedLsp());
         }
         state.storeNode(topologyAugment,
@@ -418,7 +418,7 @@ public abstract class AbstractTopologySessionListener<S, L> implements TopologyS
             }
             rlb.setPath(updatedPaths);
         }
-        rlb.setKey(new ReportedLspKey(name));
+        rlb.withKey(new ReportedLspKey(name));
         rlb.setName(name);
 
         // If this is an unsolicited update. We need to make sure we retain the metadata already present
@@ -429,7 +429,7 @@ public abstract class AbstractTopologySessionListener<S, L> implements TopologyS
         }
 
         final ReportedLsp rl = rlb.build();
-        ctx.trans.put(LogicalDatastoreType.OPERATIONAL, this.pccIdentifier.child(ReportedLsp.class, rlb.getKey()), rl);
+        ctx.trans.put(LogicalDatastoreType.OPERATIONAL, this.pccIdentifier.child(ReportedLsp.class, rlb.key()), rl);
         LOG.debug("LSP {} updated to MD-SAL", name);
 
         this.lspData.put(name, rl);
@@ -596,7 +596,7 @@ public abstract class AbstractTopologySessionListener<S, L> implements TopologyS
                 .map(ReportedLsp::getPath).filter(Objects::nonNull).filter(pathList -> !pathList.isEmpty())
                 // pick the first path, as delegate status should be same in each path
                 .map(pathList -> pathList.get(0))
-                .map(path -> path.getAugmentation(Path1.class)).filter(Objects::nonNull)
+                .map(path -> path.augmentation(Path1.class)).filter(Objects::nonNull)
                 .map(LspObject::getLsp).filter(Objects::nonNull)
                 .filter(Lsp::isDelegate)
                 .count());
index 9a88f2181a091f21fe25e5a9eaea1caf50c565ca..903d04b2d3f54b2b0a039b5ff1119250c78cd1fe 100644 (file)
@@ -84,9 +84,9 @@ final class PCEPStatefulPeerProposal {
     }
 
     private static boolean isSynOptimizationEnabled(final TlvsBuilder openTlvsBuilder) {
-        final Tlvs1 statefulTlv = openTlvsBuilder.getAugmentation(Tlvs1.class);
+        final Tlvs1 statefulTlv = openTlvsBuilder.augmentation(Tlvs1.class);
         if (statefulTlv != null && statefulTlv.getStateful() != null) {
-            return statefulTlv.getStateful().getAugmentation(Stateful1.class) != null;
+            return statefulTlv.getStateful().augmentation(Stateful1.class) != null;
         }
         return false;
     }
index 63a1b1ffa3942f887bc8913453e66d057b268b6f..afba430edce2ebc7f9e0dd392e87115f6fcaa6ec 100755 (executable)
@@ -104,7 +104,7 @@ final class ServerSessionManager implements PCEPSessionListenerFactory, Topology
         final TopologyKey key = InstanceIdentifier.keyOf(this.topology);
         final TopologyId topologyId = key.getTopologyId();
         final WriteTransaction tx = this.dependenciesProvider.getDataBroker().newWriteOnlyTransaction();
-        tx.put(LogicalDatastoreType.OPERATIONAL, this.topology, new TopologyBuilder().setKey(key)
+        tx.put(LogicalDatastoreType.OPERATIONAL, this.topology, new TopologyBuilder().withKey(key)
                 .setTopologyId(topologyId).setTopologyTypes(new TopologyTypesBuilder()
                         .addAugmentation(TopologyTypes1.class, new TopologyTypes1Builder().setTopologyPcep(
                                 new TopologyPcepBuilder().build()).build()).build())
index 6bb3c519eb5fb80a6b1e92222e6da18de508af9c..584227f3bc9eaa5096543ab6a76fa6f0185e1df3 100644 (file)
@@ -114,9 +114,9 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
     private static LspDbVersion geLspDbVersionTlv(final Lsp lsp) {
         final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.object
                 .lsp.Tlvs tlvs = lsp.getTlvs();
-        if (tlvs != null && tlvs.getAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
+        if (tlvs != null && tlvs.augmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
                 .controller.pcep.sync.optimizations.rev171025.Tlvs1.class) != null) {
-            return tlvs.getAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller
+            return tlvs.augmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller
                     .pcep.sync.optimizations.rev171025.Tlvs1.class).getLspDbVersion();
         }
         return null;
@@ -127,8 +127,8 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
         final InetAddress peerAddress = session.getRemoteAddress();
 
         final Tlvs tlvs = session.getRemoteTlvs();
-        if (tlvs != null && tlvs.getAugmentation(Tlvs1.class) != null) {
-            final Stateful stateful = tlvs.getAugmentation(Tlvs1.class).getStateful();
+        if (tlvs != null && tlvs.augmentation(Tlvs1.class) != null) {
+            final Stateful stateful = tlvs.augmentation(Tlvs1.class).getStateful();
             if (stateful != null) {
                 setStatefulCapabilities(stateful);
                 pccBuilder.setReportedLsp(Collections.emptyList());
@@ -142,7 +142,7 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
                     pccBuilder.setStateSync(PccSyncState.InitialResync);
                 }
                 pccBuilder.setStatefulTlv(new StatefulTlvBuilder().addAugmentation(StatefulTlv1.class,
-                        new StatefulTlv1Builder(tlvs.getAugmentation(Tlvs1.class)).build()).build());
+                        new StatefulTlv1Builder(tlvs.augmentation(Tlvs1.class)).build()).build());
             } else {
                 LOG.debug("Peer {} does not advertise stateful TLV", peerAddress);
             }
@@ -303,8 +303,8 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
         solicited = isSolicited(srp, lsp, ctx, rlb);
 
         // if remove flag is set in SRP object, remove the tunnel immediately
-        if (solicited && srp.getAugmentation(Srp1.class) != null) {
-            final Srp1 initiatedSrp = srp.getAugmentation(Srp1.class);
+        if (solicited && srp.augmentation(Srp1.class) != null) {
+            final Srp1 initiatedSrp = srp.augmentation(Srp1.class);
             if (initiatedSrp.isRemove()) {
                 super.removeLsp(ctx, plspid);
                 return false;
@@ -457,7 +457,7 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
             ub.setUpdates(Collections.singletonList(rb.build()));
             msg = new PcupdBuilder().setPcupdMessage(ub.build()).build();
         } else {
-            final Lsp1 lspCreateFlag = reportedLsp.getAugmentation(Lsp1.class);
+            final Lsp1 lspCreateFlag = reportedLsp.augmentation(Lsp1.class);
             // we only retake delegation for PCE initiated tunnels
             if (lspCreateFlag != null && !lspCreateFlag.isCreate()) {
                 LOG.warn("Unable to retake delegation of PCC-initiated tunnel: {}", reportedLsp);
@@ -496,7 +496,7 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
         Preconditions.checkArgument(input != null && input.getName() != null && input.getNode() != null
                 && input.getArguments() != null, MISSING_XML_TAG);
         final OperationalStatus op;
-        final Arguments1 aa = input.getArguments().getAugmentation(Arguments1.class);
+        final Arguments1 aa = input.getArguments().augmentation(Arguments1.class);
         if (aa != null) {
             op = aa.getOperational();
         } else {
@@ -522,7 +522,7 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
             }
             // check if at least one of the paths has the same status as requested
             for (final Path p : rep.get().getPath()) {
-                final Path1 p1 = p.getAugmentation(Path1.class);
+                final Path1 p1 = p.augmentation(Path1.class);
                 if (p1 == null) {
                     LOG.warn("Node {} LSP {} does not contain data", input.getNode(), input.getName());
                     return OperationResults.UNSENT;
@@ -542,7 +542,7 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
             return null;
         }
         // it doesn't matter how many lsps there are in the path list, we only need data that is the same in each path
-        final Path1 ra = rep.get().getPath().get(0).getAugmentation(Path1.class);
+        final Path1 ra = rep.get().getPath().get(0).augmentation(Path1.class);
         Preconditions.checkState(ra != null, "Reported LSP reported null from data-store.");
         final Lsp reportedLsp = ra.getLsp();
         Preconditions.checkState(reportedLsp != null, "Reported LSP does not contain LSP object.");
@@ -551,7 +551,7 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
 
     private Optional<PathSetupType> getPST(final Optional<ReportedLsp> rep) {
         if (rep.isPresent()) {
-            final Path1 path1 = rep.get().getPath().get(0).getAugmentation(Path1.class);
+            final Path1 path1 = rep.get().getPath().get(0).augmentation(Path1.class);
             if (path1 != null) {
                 final PathSetupType pst = path1.getPathSetupType();
                 if (!PSTUtil.isDefaultPST(pst)) {
@@ -569,13 +569,13 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
     protected synchronized void loadLspData(final Node node, final Map<String, ReportedLsp> lspData,
             final Map<PlspId, String> lsps, final boolean incrementalSynchro) {
         //load node's lsps from DS
-        final PathComputationClient pcc = node.getAugmentation(Node1.class).getPathComputationClient();
+        final PathComputationClient pcc = node.augmentation(Node1.class).getPathComputationClient();
         final List<ReportedLsp> reportedLsps = pcc.getReportedLsp();
         for (final ReportedLsp reportedLsp : reportedLsps) {
             final String lspName = reportedLsp.getName();
             lspData.put(lspName, reportedLsp);
             if (!reportedLsp.getPath().isEmpty()) {
-                final Path1 path1 = reportedLsp.getPath().get(0).getAugmentation(Path1.class);
+                final Path1 path1 = reportedLsp.getPath().get(0).augmentation(Path1.class);
                 if (path1 != null) {
                     final PlspId plspId = path1.getLsp().getPlspId();
                     if (!incrementalSynchro) {
@@ -630,7 +630,7 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
         if (stateful.isLspUpdateCapability() != null) {
             this.lspUpdateCapability.set(stateful.isLspUpdateCapability());
         }
-        final Stateful1 stateful1 = stateful.getAugmentation(Stateful1.class);
+        final Stateful1 stateful1 = stateful.augmentation(Stateful1.class);
         if (stateful1 != null && stateful1.isInitiation() != null) {
             this.initiationCapability.set(stateful1.isInitiation());
         }
@@ -653,7 +653,7 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
             // mark lsp as stale
             final ReportedLsp staleLsp = rep.get();
             if (!staleLsp.getPath().isEmpty()) {
-                final Path1 path1 = staleLsp.getPath().get(0).getAugmentation(Path1.class);
+                final Path1 path1 = staleLsp.getPath().get(0).augmentation(Path1.class);
                 if (path1 != null) {
                     Stateful07TopologySessionListener.this.staleLsps.add(path1.getLsp().getPlspId());
                 }
@@ -714,7 +714,7 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
 
             // Build the request
             final RequestsBuilder rb = new RequestsBuilder();
-            final Arguments2 args = this.input.getArguments().getAugmentation(Arguments2.class);
+            final Arguments2 args = this.input.getArguments().augmentation(Arguments2.class);
             final Lsp inputLsp = (args != null) ? args.getLsp() : null;
             if (inputLsp == null) {
                 return OperationResults.createUnsent(PCEPErrors.LSP_MISSING).future();
@@ -770,7 +770,7 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
                 return OperationResults.createUnsent(PCEPErrors.UNKNOWN_PLSP_ID).future();
             }
             // create mandatory objects
-            final Arguments3 args = this.input.getArguments().getAugmentation(Arguments3.class);
+            final Arguments3 args = this.input.getArguments().augmentation(Arguments3.class);
             final SrpBuilder srpBuilder = new SrpBuilder();
             srpBuilder.setOperationId(nextRequest());
             srpBuilder.setProcessingRule(Boolean.TRUE);
index 150c48e5b9e74182dbf1504f6c1a9f10108f8341..0173f1980576398f500b330cc604b5c5469a6a61 100644 (file)
@@ -67,7 +67,7 @@ final class SyncOptimization {
 
     private static LspDbVersion getLspDbVersion(final Tlvs openTlvs) {
         if (openTlvs != null) {
-            final Tlvs3 tlvs3 = openTlvs.getAugmentation(Tlvs3.class);
+            final Tlvs3 tlvs3 = openTlvs.augmentation(Tlvs3.class);
             if (tlvs3 != null && tlvs3.getLspDbVersion() != null
                     && tlvs3.getLspDbVersion().getLspDbVersionValue() != null) {
                 return tlvs3.getLspDbVersion();
@@ -85,9 +85,9 @@ final class SyncOptimization {
 
     private static Stateful1 getStateful1(final Tlvs openTlvs) {
         if (openTlvs != null) {
-            final Tlvs1 tlvs1 = openTlvs.getAugmentation(Tlvs1.class);
+            final Tlvs1 tlvs1 = openTlvs.augmentation(Tlvs1.class);
             if (tlvs1 != null && tlvs1.getStateful() != null) {
-                return tlvs1.getStateful().getAugmentation(Stateful1.class);
+                return tlvs1.getStateful().augmentation(Stateful1.class);
             }
         }
         return null;
index fdc5c4541bc9d3fede235d692880a7fae86f83c7..c6ceb5a2c0fde8445ffbadb21bf50c78eb27321f 100644 (file)
@@ -166,7 +166,7 @@ final class TopologyNodeState implements AutoCloseable, TransactionChainListener
     }
 
     private synchronized void putTopologyNode() {
-        final Node node = new NodeBuilder().setKey(this.nodeId.getKey())
+        final Node node = new NodeBuilder().withKey(this.nodeId.getKey())
                 .setNodeId(this.nodeId.getKey().getNodeId()).build();
         final WriteTransaction t = this.chain.newWriteOnlyTransaction();
         LOG.trace("Put topology Node {}, value {}", this.nodeId, node);
index 34ca7ae3b56123a98a2e9ea5eddaa92e6b9cb189..469d7cc41fafae7cb8c5643ae935bb24a342ece6 100644 (file)
@@ -105,7 +105,7 @@ public class PCEPTopologyDeployerImpl implements ClusteredDataTreeChangeListener
         LOG.info("Creating Topology {}", topologyId);
         LOG.trace("Topology {}.", topology);
 
-        final SessionConfig config = topology.getAugmentation(PcepTopologyTypeConfig.class).getSessionConfig();
+        final SessionConfig config = topology.augmentation(PcepTopologyTypeConfig.class).getSessionConfig();
         final InstructionScheduler instructionScheduler = this.instructionSchedulerFactory
                 .createInstructionScheduler(topologyId.getValue());
 
index 4bbcee35263b4d654c346a9dc088aaf4b8f70bc6..f8427696488e18d8d4b0cc6a34b72ae991147824 100644 (file)
@@ -40,14 +40,14 @@ final class PCEPTopologyProviderUtil {
         final KeyMapping ret = KeyMapping.getKeyMapping();
         topology.getNode().stream()
                 .filter(Objects::nonNull)
-                .filter(node -> node.getAugmentation(PcepNodeConfig.class) != null)
-                .filter(node -> node.getAugmentation(PcepNodeConfig.class).getSessionConfig() != null)
-                .filter(node -> node.getAugmentation(PcepNodeConfig.class)
+                .filter(node -> node.augmentation(PcepNodeConfig.class) != null)
+                .filter(node -> node.augmentation(PcepNodeConfig.class).getSessionConfig() != null)
+                .filter(node -> node.augmentation(PcepNodeConfig.class)
                         .getSessionConfig().getPassword() != null)
-                .filter(node -> !node.getAugmentation(PcepNodeConfig.class)
+                .filter(node -> !node.augmentation(PcepNodeConfig.class)
                         .getSessionConfig().getPassword().getValue().isEmpty())
                 .forEach(node -> {
-                    final PcepNodeConfig config = node.getAugmentation(PcepNodeConfig.class);
+                    final PcepNodeConfig config = node.augmentation(PcepNodeConfig.class);
                     final Rfc2385Key rfc2385KeyPassword = config.getSessionConfig().getPassword();
                     final InetAddress address = InetAddresses.forString(node.getNodeId().getValue());
                     ret.put(address, rfc2385KeyPassword.getValue().getBytes(StandardCharsets.US_ASCII));
@@ -64,7 +64,7 @@ final class PCEPTopologyProviderUtil {
         if (topologyTypes == null) {
             return false;
         }
-        final TopologyTypes1 aug = topologyTypes.getAugmentation(TopologyTypes1.class);
+        final TopologyTypes1 aug = topologyTypes.augmentation(TopologyTypes1.class);
 
         return aug != null && aug.getTopologyPcep() != null;
     }
@@ -74,14 +74,14 @@ final class PCEPTopologyProviderUtil {
         final SpeakerIdMapping ret = SpeakerIdMapping.getSpeakerIdMap();
         topology.getNode().stream()
                 .filter(Objects::nonNull)
-                .filter(node -> node.getAugmentation(PcepNodeConfig.class) != null)
-                .filter(node -> node.getAugmentation(PcepNodeConfig.class).getSessionConfig() != null)
-                .filter(node -> node.getAugmentation(PcepNodeConfig.class).getSessionConfig()
-                        .getAugmentation(PcepNodeSyncConfig.class) != null)
+                .filter(node -> node.augmentation(PcepNodeConfig.class) != null)
+                .filter(node -> node.augmentation(PcepNodeConfig.class).getSessionConfig() != null)
+                .filter(node -> node.augmentation(PcepNodeConfig.class).getSessionConfig()
+                        .augmentation(PcepNodeSyncConfig.class) != null)
                 .forEach(node -> {
-                    final PcepNodeConfig config = node.getAugmentation(PcepNodeConfig.class);
+                    final PcepNodeConfig config = node.augmentation(PcepNodeConfig.class);
                     final PcepNodeSyncConfig nodeSyncConfig = config.getSessionConfig()
-                            .getAugmentation(PcepNodeSyncConfig.class);
+                            .augmentation(PcepNodeSyncConfig.class);
                     final InetAddress address = InetAddresses.forString(node.getNodeId().getValue());
                     ret.put(address, nodeSyncConfig.getSpeakerEntityIdValue());
                 });
index 6350c7e094228d9c95bfa72ffc4d79d56542d515..205a8bec30f0d90edf0f1c1d396b011e7faf94bd 100644 (file)
@@ -65,8 +65,8 @@ public final class SessionStateImpl implements PcepSessionState {
         this.pcepSessionState = session;
         final Open localOpen = session.getLocalOpen();
 
-        if (localOpen.getTlvs() != null && localOpen.getTlvs().getAugmentation(Tlvs3.class) != null) {
-            final SpeakerEntityId entityId = localOpen.getTlvs().getAugmentation(Tlvs3.class).getSpeakerEntityId();
+        if (localOpen.getTlvs() != null && localOpen.getTlvs().augmentation(Tlvs3.class) != null) {
+            final SpeakerEntityId entityId = localOpen.getTlvs().augmentation(Tlvs3.class).getSpeakerEntityId();
             if (entityId != null) {
                 this.localPref = new LocalPrefBuilder(session.getLocalPref())
                         .addAugmentation(PcepEntityIdStatsAug.class,
index 96f3a5b9963e80d99dca9b603c80dcf04a09b7ff..2904bc7547643a722a22d3ff05108df7c300b95d 100644 (file)
@@ -90,7 +90,7 @@ public class PCEPStatefulPeerProposalTest {
         final PCEPStatefulPeerProposal peerProposal = PCEPStatefulPeerProposal
                 .createStatefulPeerProposal(this.dataBroker, TOPOLOGY_IID);
         peerProposal.setPeerProposal(NODE_ID, this.tlvsBuilder, null);
-        assertEquals(LSP_DB_VERSION, this.tlvsBuilder.getAugmentation(Tlvs3.class).getLspDbVersion());
+        assertEquals(LSP_DB_VERSION, this.tlvsBuilder.augmentation(Tlvs3.class).getLspDbVersion());
     }
 
     @Test
@@ -99,7 +99,7 @@ public class PCEPStatefulPeerProposalTest {
         final PCEPStatefulPeerProposal peerProposal = PCEPStatefulPeerProposal
                 .createStatefulPeerProposal(this.dataBroker, TOPOLOGY_IID);
         peerProposal.setPeerProposal(NODE_ID, this.tlvsBuilder, SPEAKER_ID);
-        final Tlvs3 aug = this.tlvsBuilder.getAugmentation(Tlvs3.class);
+        final Tlvs3 aug = this.tlvsBuilder.augmentation(Tlvs3.class);
         assertEquals(LSP_DB_VERSION, aug.getLspDbVersion());
         assertArrayEquals(SPEAKER_ID, aug.getSpeakerEntityId().getSpeakerEntityIdValue());
     }
@@ -110,7 +110,7 @@ public class PCEPStatefulPeerProposalTest {
         final PCEPStatefulPeerProposal peerProposal = PCEPStatefulPeerProposal
                 .createStatefulPeerProposal(this.dataBroker, TOPOLOGY_IID);
         peerProposal.setPeerProposal(NODE_ID, this.tlvsBuilder, null);
-        assertNull(this.tlvsBuilder.getAugmentation(Tlvs3.class));
+        assertNull(this.tlvsBuilder.augmentation(Tlvs3.class));
     }
 
     @Test
@@ -119,7 +119,7 @@ public class PCEPStatefulPeerProposalTest {
         final PCEPStatefulPeerProposal peerProposal = PCEPStatefulPeerProposal
                 .createStatefulPeerProposal(this.dataBroker, TOPOLOGY_IID);
         peerProposal.setPeerProposal(NODE_ID, this.tlvsBuilder, null);
-        assertNull(this.tlvsBuilder.getAugmentation(Tlvs3.class));
+        assertNull(this.tlvsBuilder.augmentation(Tlvs3.class));
     }
 
 }
index 655d8e66756958110e7f2ac6cae5b7c22a4219f3..eccd56752613f071b982c452d119389e5da78c13 100755 (executable)
@@ -179,13 +179,13 @@ public class Stateful07TopologySessionListenerTest
         checkEquals(() -> assertEquals(1, listenerState.getDelegatedLspsCount().intValue()));
         checkEquals(() -> assertTrue(this.listener.isSessionSynchronized()));
         checkEquals(() -> assertTrue(listenerState.getMessages()
-                .getAugmentation(StatefulMessagesStatsAug.class).getLastReceivedRptMsgTimestamp() > 0));
+                .augmentation(StatefulMessagesStatsAug.class).getLastReceivedRptMsgTimestamp() > 0));
         checkEquals(() -> assertEquals(2, listenerState.getMessages()
-                .getAugmentation(StatefulMessagesStatsAug.class).getReceivedRptMsgCount().intValue()));
+                .augmentation(StatefulMessagesStatsAug.class).getReceivedRptMsgCount().intValue()));
         checkEquals(() -> assertEquals(1, listenerState.getMessages()
-                .getAugmentation(StatefulMessagesStatsAug.class).getSentInitMsgCount().intValue()));
+                .augmentation(StatefulMessagesStatsAug.class).getSentInitMsgCount().intValue()));
         checkEquals(() -> assertEquals(0, listenerState.getMessages()
-                .getAugmentation(StatefulMessagesStatsAug.class).getSentUpdMsgCount().intValue()));
+                .augmentation(StatefulMessagesStatsAug.class).getSentUpdMsgCount().intValue()));
 
         // update-lsp
         final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.update.lsp.args
@@ -223,7 +223,7 @@ public class Stateful07TopologySessionListenerTest
             assertEquals(1, listenerState.getDelegatedLspsCount().intValue());
             assertTrue(this.listener.isSessionSynchronized());
             final StatefulMessagesStatsAug statefulstate = listenerState.getMessages()
-                    .getAugmentation(StatefulMessagesStatsAug.class);
+                    .augmentation(StatefulMessagesStatsAug.class);
             assertTrue(statefulstate.getLastReceivedRptMsgTimestamp() > 0);
             assertEquals(3, statefulstate.getReceivedRptMsgCount().intValue());
             assertEquals(1, statefulstate.getSentInitMsgCount().intValue());
@@ -232,7 +232,7 @@ public class Stateful07TopologySessionListenerTest
             assertTrue(replyTime.getAverageTime() > 0);
             assertTrue(replyTime.getMaxTime() > 0);
             final StatefulCapabilitiesStatsAug statefulCapabilities = listenerState
-                    .getPeerCapabilities().getAugmentation(StatefulCapabilitiesStatsAug.class);
+                    .getPeerCapabilities().augmentation(StatefulCapabilitiesStatsAug.class);
             assertFalse(statefulCapabilities.isActive());
             assertTrue(statefulCapabilities.isInstantiation());
             assertTrue(statefulCapabilities.isStateful());
@@ -277,13 +277,13 @@ public class Stateful07TopologySessionListenerTest
         checkEquals(() -> assertEquals(0, listenerState.getDelegatedLspsCount().intValue()));
         checkEquals(() -> assertTrue(this.listener.isSessionSynchronized()));
         checkEquals(() -> assertTrue(listenerState.getMessages()
-                .getAugmentation(StatefulMessagesStatsAug.class).getLastReceivedRptMsgTimestamp() > 0));
+                .augmentation(StatefulMessagesStatsAug.class).getLastReceivedRptMsgTimestamp() > 0));
         checkEquals(() -> assertEquals(4, listenerState.getMessages()
-                .getAugmentation(StatefulMessagesStatsAug.class).getReceivedRptMsgCount().intValue()));
+                .augmentation(StatefulMessagesStatsAug.class).getReceivedRptMsgCount().intValue()));
         checkEquals(() -> assertEquals(2, listenerState.getMessages()
-                .getAugmentation(StatefulMessagesStatsAug.class).getSentInitMsgCount().intValue()));
+                .augmentation(StatefulMessagesStatsAug.class).getSentInitMsgCount().intValue()));
         checkEquals(() -> assertEquals(1, listenerState.getMessages()
-                .getAugmentation(StatefulMessagesStatsAug.class).getSentUpdMsgCount().intValue()));
+                .augmentation(StatefulMessagesStatsAug.class).getSentUpdMsgCount().intValue()));
     }
 
     @Test
index ea6890e7f35bf4450fe8307e7f038f4a4cc0a0ee..df243f71fdec3fb30b9ba272bae21636af2f0fae 100644 (file)
@@ -86,8 +86,8 @@ final class CreateTunnelInstructionExecutor extends AbstractInstructionExecutor
 
     private static AddressFamily buildAddressFamily(final TerminationPoint sp, final TerminationPoint dp) {
         // We need the IGP augmentation -- it has IP addresses
-        final TerminationPoint1 sp1 = requireNonNull(sp.getAugmentation(TerminationPoint1.class));
-        final TerminationPoint1 dp1 = requireNonNull(dp.getAugmentation(TerminationPoint1.class));
+        final TerminationPoint1 sp1 = requireNonNull(sp.augmentation(TerminationPoint1.class));
+        final TerminationPoint1 dp1 = requireNonNull(dp.augmentation(TerminationPoint1.class));
 
         // Get the types
         final TerminationPointType spt = sp1.getIgpTerminationPointAttributes().getTerminationPointType();
@@ -190,7 +190,7 @@ final class CreateTunnelInstructionExecutor extends AbstractInstructionExecutor
         args.setEro(TunelProgrammingUtil.buildEro(this.p2pTunnelInput.getExplicitHops()));
         args.setLspa(new LspaBuilder(this.p2pTunnelInput).build());
 
-        final AdministrativeStatus adminStatus = this.p2pTunnelInput.getAugmentation(PcepCreateP2pTunnelInput1.class)
+        final AdministrativeStatus adminStatus = this.p2pTunnelInput.augmentation(PcepCreateP2pTunnelInput1.class)
                 .getAdministrativeStatus();
         if (adminStatus != null) {
             args.addAugmentation(Arguments2.class, new Arguments2Builder().setLsp(new LspBuilder()
index b22f94adfba28bae5f980f030e69c2c55e475eb4..501511e2a61bb56daecd67004af53b2ff1179c4b 100644 (file)
@@ -63,8 +63,8 @@ final class DestroyTunnelInstructionExecutor extends AbstractInstructionExecutor
                 return TunelProgrammingUtil.RESULT;
             }
             final RemoveLspInputBuilder ab = new RemoveLspInputBuilder();
-            ab.setName(link.getAugmentation(Link1.class).getSymbolicPathName());
-            ab.setNode(node.getSupportingNode().get(0).getKey().getNodeRef());
+            ab.setName(link.augmentation(Link1.class).getSymbolicPathName());
+            ab.setNode(node.getSupportingNode().get(0).key().getNodeRef());
             return Futures.transform(
                 (ListenableFuture<RpcResult<RemoveLspOutput>>) this.topologyService.removeLsp(ab.build()),
                 RpcResult::getResult, MoreExecutors.directExecutor());
index 78bea0ed16094156ee47bde6c23b6c3599747e77..178b11712417cf7fdee4e110929df691cfeb4cd1 100644 (file)
@@ -112,7 +112,7 @@ public final class NodeChangedListener implements ClusteredDataTreeChangeListene
             LOG.trace("Skipping null node", id);
             return;
         }
-        final Node1 pccnode = node.getAugmentation(Node1.class);
+        final Node1 pccnode = node.augmentation(Node1.class);
         if (pccnode == null) {
             LOG.trace("Skipping non-PCEP-enabled node {}", id);
             return;
@@ -120,7 +120,7 @@ public final class NodeChangedListener implements ClusteredDataTreeChangeListene
 
         for (final ReportedLsp l : pccnode.getPathComputationClient().getReportedLsp()) {
             lsps.add(id.builder().augmentation(Node1.class).child(PathComputationClient.class)
-                    .child(ReportedLsp.class, l.getKey()).build());
+                    .child(ReportedLsp.class, l.key()).build());
         }
     }
 
@@ -141,7 +141,7 @@ public final class NodeChangedListener implements ClusteredDataTreeChangeListene
         final SupportingNodeKey sk = new SupportingNodeKey(sni, this.source);
         final SupportingNodeBuilder snb = new SupportingNodeBuilder();
         snb.setNodeRef(sni);
-        snb.setKey(sk);
+        snb.withKey(sk);
         snb.addAugmentation(SupportingNode1.class, new SupportingNode1Builder().setPathComputationClient(
                 new PathComputationClientBuilder().setControlling(inControl).build()).build());
 
@@ -168,8 +168,8 @@ public final class NodeChangedListener implements ClusteredDataTreeChangeListene
             }
             if (!have) {
                 final SupportingNode sn = createSupportingNode(k.getNodeId(), inControl);
-                trans.put(LogicalDatastoreType.OPERATIONAL, this.target.child(Node.class, node.getKey()).child(
-                        SupportingNode.class, sn.getKey()), sn);
+                trans.put(LogicalDatastoreType.OPERATIONAL, this.target.child(Node.class, node.key()).child(
+                        SupportingNode.class, sn.key()), sn);
             }
         }
     }
@@ -182,7 +182,7 @@ public final class NodeChangedListener implements ClusteredDataTreeChangeListene
             for (final Node n : topo.getNode()) {
                 if (n.getTerminationPoint() != null) {
                     for (final TerminationPoint tp : n.getTerminationPoint()) {
-                        final TerminationPoint1 tpa = tp.getAugmentation(TerminationPoint1.class);
+                        final TerminationPoint1 tpa = tp.augmentation(TerminationPoint1.class);
                         if (tpa != null) {
                             final TerminationPointType tpt = tpa.getIgpTerminationPointAttributes()
                                     .getTerminationPointType();
@@ -190,8 +190,8 @@ public final class NodeChangedListener implements ClusteredDataTreeChangeListene
                                 for (final IpAddress address : ((Ip) tpt).getIpAddress()) {
                                     if (addr.equals(address)) {
                                         handleSni(sni, n, inControl, trans);
-                                        return this.target.builder().child(Node.class, n.getKey())
-                                                .child(TerminationPoint.class, tp.getKey()).build();
+                                        return this.target.builder().child(Node.class, n.key())
+                                                .child(TerminationPoint.class, tp.key()).build();
                                     }
                                 }
                             } else {
@@ -211,29 +211,29 @@ public final class NodeChangedListener implements ClusteredDataTreeChangeListene
         final String url = "ip://" + addr.toString();
         final TerminationPointKey tpk = new TerminationPointKey(new TpId(url));
         final TerminationPointBuilder tpb = new TerminationPointBuilder();
-        tpb.setKey(tpk).setTpId(tpk.getTpId());
+        tpb.withKey(tpk).setTpId(tpk.getTpId());
         tpb.addAugmentation(TerminationPoint1.class, new TerminationPoint1Builder().setIgpTerminationPointAttributes(
                 new IgpTerminationPointAttributesBuilder().setTerminationPointType(
                         new IpBuilder().setIpAddress(Lists.newArrayList(addr)).build()).build()).build());
 
         final NodeKey nk = new NodeKey(new NodeId(url));
         final NodeBuilder nb = new NodeBuilder();
-        nb.setKey(nk).setNodeId(nk.getNodeId());
+        nb.withKey(nk).setNodeId(nk.getNodeId());
         nb.setTerminationPoint(Lists.newArrayList(tpb.build()));
         if (sni != null) {
             nb.setSupportingNode(Lists.newArrayList(createSupportingNode(InstanceIdentifier.keyOf(sni).getNodeId(),
                     inControl)));
         }
-        final InstanceIdentifier<Node> nid = this.target.child(Node.class, nb.getKey());
+        final InstanceIdentifier<Node> nid = this.target.child(Node.class, nb.key());
         trans.put(LogicalDatastoreType.OPERATIONAL, nid, nb.build());
-        return nid.child(TerminationPoint.class, tpb.getKey());
+        return nid.child(TerminationPoint.class, tpb.key());
     }
 
     private void create(final ReadWriteTransaction trans, final InstanceIdentifier<ReportedLsp> identifier,
             final ReportedLsp value) throws ReadFailedException {
         final InstanceIdentifier<Node> ni = identifier.firstIdentifierOf(Node.class);
 
-        final Path1 rl = value.getPath().get(0).getAugmentation(Path1.class);
+        final Path1 rl = value.getPath().get(0).augmentation(Path1.class);
 
         final AddressFamily af = rl.getLsp().getTlvs().getLspIdentifiers().getAddressFamily();
 
index 7621573495945ae12b9d00965ba88c3526d70644..6d432348e73037f2c5a74c5e62d96319eb79e345 100644 (file)
@@ -68,7 +68,7 @@ final class TunelProgrammingUtil {
             final List<Subobject> subobjs = new ArrayList<>(explicitHops.size());
             for (final ExplicitHops h : explicitHops) {
 
-                final ExplicitHops1 h1 = h.getAugmentation(ExplicitHops1.class);
+                final ExplicitHops1 h1 = h.augmentation(ExplicitHops1.class);
                 if (h1 != null) {
                     final SubobjectBuilder sb = new SubobjectBuilder();
                     sb.fieldsFrom(h1);
@@ -85,9 +85,9 @@ final class TunelProgrammingUtil {
 
     public static NodeId supportingNode(final Node node) {
         for (final SupportingNode n : node.getSupportingNode()) {
-            final SupportingNode1 n1 = n.getAugmentation(SupportingNode1.class);
+            final SupportingNode1 n1 = n.augmentation(SupportingNode1.class);
             if (n1 != null && n1.getPathComputationClient().isControlling()) {
-                return n.getKey().getNodeRef();
+                return n.key().getNodeRef();
             }
         }
 
index bfea7c9ebdb97883b72b0876162d55cc5a7fcb7a..3ed8af34c05d25d44fea08de61313c2923bb9d1c 100644 (file)
@@ -108,7 +108,7 @@ public final class TunnelProviderDeployer implements ClusteredDataTreeChangeList
         if (topologyTypes == null) {
             return false;
         }
-        final TopologyTypes1 aug = topologyTypes.getAugmentation(TopologyTypes1.class);
+        final TopologyTypes1 aug = topologyTypes.augmentation(TopologyTypes1.class);
         return aug != null && aug.getTopologyTunnelPcep() != null;
     }
 
@@ -123,7 +123,7 @@ public final class TunnelProviderDeployer implements ClusteredDataTreeChangeList
         }
         LOG.debug("Create Tunnel Topology {}", topologyId);
 
-        final PcepTunnelTopologyConfig config = topology.getAugmentation(PcepTunnelTopologyConfig.class);
+        final PcepTunnelTopologyConfig config = topology.augmentation(PcepTunnelTopologyConfig.class);
         final String pcepTopoID = StringUtils
                 .substringBetween(config.getPcepTopologyReference().getValue(), "=\"", "\"");
         final InstanceIdentifier<Topology> pcepTopoRef = InstanceIdentifier.builder(NetworkTopology.class)
index fce111a7064892ef9d35e02e5524420331b80282..fb7a9d2fb5a0cbf732546de62d6a4152bc890520 100644 (file)
@@ -82,7 +82,7 @@ final class UpdateTunnelInstructionExecutor extends AbstractInstructionExecutor
 
     private UpdateLspInput buildUpdateInput(final Link link, final Node node) {
         final UpdateLspInputBuilder ab = new UpdateLspInputBuilder();
-        ab.setName(link.getAugmentation(Link1.class).getSymbolicPathName());
+        ab.setName(link.augmentation(Link1.class).getSymbolicPathName());
         ab.setNode(requireNonNull(TunelProgrammingUtil.supportingNode(node)));
 
         final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.update.lsp
@@ -93,7 +93,7 @@ final class UpdateTunnelInstructionExecutor extends AbstractInstructionExecutor
         args.setEro(TunelProgrammingUtil.buildEro(this.updateTunnelInput.getExplicitHops()));
         args.setLspa(new LspaBuilder(this.updateTunnelInput).build());
 
-        final AdministrativeStatus adminStatus = this.updateTunnelInput.getAugmentation(PcepUpdateTunnelInput1.class)
+        final AdministrativeStatus adminStatus = this.updateTunnelInput.augmentation(PcepUpdateTunnelInput1.class)
                 .getAdministrativeStatus();
         if (adminStatus != null) {
             args.addAugmentation(Arguments3.class, new Arguments3Builder().setLsp(new LspBuilder()
index bce6dadd5952836dba2240ca5f0c9b3e3fbeaf8f..d6c0a0e52937c4818ef326b99e1b0ba5ac7b89b0 100644 (file)
@@ -88,10 +88,10 @@ public class NodeChangedListenerTest extends AbstractConcurrentDataBrokerTest {
     public void setUp() throws InterruptedException, ExecutionException {
         final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
         wTx.put(LogicalDatastoreType.OPERATIONAL, PCEP_TOPO_IID, new TopologyBuilder()
-                .setKey(new TopologyKey(PCEP_TOPOLOGY_ID)).setNode(Lists.newArrayList())
+                .withKey(new TopologyKey(PCEP_TOPOLOGY_ID)).setNode(Lists.newArrayList())
                 .setTopologyId(PCEP_TOPOLOGY_ID).build(), true);
         wTx.put(LogicalDatastoreType.OPERATIONAL, TUNNEL_TOPO_IID, new TopologyBuilder()
-                .setKey(new TopologyKey(TUNNEL_TOPOLOGY_ID)).setTopologyId(TUNNEL_TOPOLOGY_ID).build(), true);
+                .withKey(new TopologyKey(TUNNEL_TOPOLOGY_ID)).setTopologyId(TUNNEL_TOPOLOGY_ID).build(), true);
         wTx.commit().get();
         final NodeChangedListener nodeListener = new NodeChangedListener(getDataBroker(),
                 PCEP_TOPOLOGY_ID, TUNNEL_TOPO_IID);
@@ -138,7 +138,7 @@ public class NodeChangedListenerTest extends AbstractConcurrentDataBrokerTest {
         Assert.assertEquals(1, src.getSupportingNode().size());
         Assert.assertNull(dst.getSupportingNode());
         final SupportingNode sNode = src.getSupportingNode().get(0);
-        Assert.assertEquals(NODE1_ID, sNode.getKey().getNodeRef());
+        Assert.assertEquals(NODE1_ID, sNode.key().getNodeRef());
 
         Assert.assertEquals(1, tunnelTopo.getLink().size());
         final Link link = tunnelTopo.getLink().get(0);
@@ -200,10 +200,10 @@ public class NodeChangedListenerTest extends AbstractConcurrentDataBrokerTest {
     private void createNode(final NodeId nodeId, final String ipv4Address, final String lspName, final long lspId,
             final String dstIpv4Address) throws InterruptedException, ExecutionException {
         final NodeBuilder nodeBuilder = new NodeBuilder();
-        nodeBuilder.setKey(new NodeKey(nodeId));
+        nodeBuilder.withKey(new NodeKey(nodeId));
         nodeBuilder.setNodeId(nodeId);
         final PathBuilder pathBuilder = new PathBuilder();
-        pathBuilder.setKey(new PathKey(new LspId(lspId)));
+        pathBuilder.withKey(new PathKey(new LspId(lspId)));
         pathBuilder.setBandwidth(new BandwidthBuilder().setBandwidth(
                 new Bandwidth(new byte[]{0x00, 0x00, (byte) 0xff, (byte) 0xff})).build());
         pathBuilder.addAugmentation(Path1.class, new Path1Builder().setLsp(new LspBuilder().setTlvs(new TlvsBuilder()
@@ -213,7 +213,7 @@ public class NodeChangedListenerTest extends AbstractConcurrentDataBrokerTest {
                                 .setIpv4TunnelEndpointAddress(new Ipv4Address(dstIpv4Address))
                                 .build()).build()).build()).build()).setAdministrative(true)
                 .setDelegate(true).build()).build());
-        final ReportedLsp reportedLps = new ReportedLspBuilder().setKey(new ReportedLspKey(lspName)).setPath(
+        final ReportedLsp reportedLps = new ReportedLspBuilder().withKey(new ReportedLspKey(lspName)).setPath(
                 Collections.singletonList(pathBuilder.build())).build();
         final Node1Builder node1Builder = new Node1Builder();
         node1Builder.setPathComputationClient(new PathComputationClientBuilder()
index 32e3d753f1b4733a0911f90235ed2d896dd049f5..5215108b93abc77723f18a56ee7d38c94a6ac775 100644 (file)
@@ -148,7 +148,7 @@ public class TunnelProgrammingTest extends AbstractConcurrentDataBrokerTest {
     private static Node createNode(final NodeId nodeId, final TpId tpId, final String ipv4Address) {
         final TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
         tpBuilder.setTpId(tpId);
-        tpBuilder.setKey(new TerminationPointKey(tpId));
+        tpBuilder.withKey(new TerminationPointKey(tpId));
         tpBuilder.addAugmentation(TerminationPoint1.class, new TerminationPoint1Builder()
                 .setIgpTerminationPointAttributes(new IgpTerminationPointAttributesBuilder()
                         .setTerminationPointType(new IpBuilder()
@@ -156,10 +156,10 @@ public class TunnelProgrammingTest extends AbstractConcurrentDataBrokerTest {
                                 .build()).build()).build());
         final NodeBuilder nodeBuilder = new NodeBuilder();
         nodeBuilder.setNodeId(nodeId);
-        nodeBuilder.setKey(new NodeKey(nodeId));
+        nodeBuilder.withKey(new NodeKey(nodeId));
         nodeBuilder.setTerminationPoint(Lists.newArrayList(tpBuilder.build()));
         final SupportingNode supportingNode = new SupportingNodeBuilder()
-                .setKey(new SupportingNodeKey(nodeId, new TopologyId("dummy")))
+                .withKey(new SupportingNodeKey(nodeId, new TopologyId("dummy")))
                 .addAugmentation(SupportingNode1.class, new SupportingNode1Builder()
                         .setPathComputationClient(new PathComputationClientBuilder()
                                 .setControlling(true).build()).build()).build();
@@ -293,7 +293,7 @@ public class TunnelProgrammingTest extends AbstractConcurrentDataBrokerTest {
 
     private void createInitialTopology() throws InterruptedException, ExecutionException {
         final TopologyBuilder topologyBuilder = new TopologyBuilder();
-        topologyBuilder.setKey(new TopologyKey(TOPOLOGY_ID));
+        topologyBuilder.withKey(new TopologyKey(TOPOLOGY_ID));
         topologyBuilder.setServerProvided(true);
         topologyBuilder.setTopologyId(TOPOLOGY_ID);
         topologyBuilder.setNode(Lists.newArrayList(createNode(NODE1_ID, TP1_ID, NODE1_IPV4),
@@ -310,7 +310,7 @@ public class TunnelProgrammingTest extends AbstractConcurrentDataBrokerTest {
         linkBuilder.setDestination(new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology
                 .rev131021.link.attributes.DestinationBuilder().setDestNode(NODE2_ID).setDestTp(TP2_ID).build());
         linkBuilder.setLinkId(LINK1_ID);
-        linkBuilder.setKey(new LinkKey(LINK1_ID));
+        linkBuilder.withKey(new LinkKey(LINK1_ID));
         linkBuilder.addAugmentation(Link1.class, new Link1Builder().setSymbolicPathName(LINK1_ID.getValue()).build());
         final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
         wTx.put(LogicalDatastoreType.OPERATIONAL, TOPO_IID.builder().child(Link.class, new LinkKey(LINK1_ID)).build(),
index 641f149d36a769118dcd934fff738c4c104ca9c0..4dd0295bdfed3f0d934b3eaa731f7ec0c895731e 100644 (file)
@@ -99,7 +99,7 @@ public final class ProgrammingServiceImpl implements ClusterSingletonService, In
         InstructionPusher(final InstructionId id, final Nanotime deadline) {
             this.builder.setDeadline(deadline);
             this.builder.setId(id);
-            this.builder.setKey(new InstructionKey(id));
+            this.builder.withKey(new InstructionKey(id));
             this.builder.setStatus(InstructionStatus.Queued);
         }
 
@@ -179,7 +179,7 @@ public final class ProgrammingServiceImpl implements ClusterSingletonService, In
 
         final WriteTransaction wt = this.dataProvider.newWriteOnlyTransaction();
         wt.put(LogicalDatastoreType.OPERATIONAL, this.qid, new InstructionsQueueBuilder()
-                .setKey(new InstructionsQueueKey(this.instructionId)).setInstruction(Collections.emptyList()).build());
+                .withKey(new InstructionsQueueKey(this.instructionId)).setInstruction(Collections.emptyList()).build());
         wt.commit().addCallback(new FutureCallback<CommitInfo>() {
             @Override
             public void onSuccess(final CommitInfo result) {
index 0e822e5dc250881de62a6419bf27252e21c9c44d..617407efe86208855a0c21130e8222616d5bc26f 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.protocol.util;
 
 import static junit.framework.TestCase.assertNull;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doReturn;
@@ -28,6 +27,7 @@ import com.google.common.base.VerifyException;
 import io.netty.channel.ChannelFuture;
 import io.netty.util.concurrent.GenericFutureListener;
 import java.util.concurrent.ExecutionException;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
@@ -162,7 +162,7 @@ public class CheckUtilTest extends AbstractConcurrentDataBrokerTest {
 
     @Test(expected = AssertionError.class)
     public void testCheckEquals() throws Exception {
-        checkEquals(() -> fail(), TIMEOUT);
+        checkEquals(Assert::fail, TIMEOUT);
     }
 
     @Test(expected = AssertionError.class)
@@ -176,4 +176,4 @@ public class CheckUtilTest extends AbstractConcurrentDataBrokerTest {
         doReturn(1).when(this.listenerCheck).getListMessageSize();
         checkReceivedMessages(this.listenerCheck, 1, TIMEOUT);
     }
-}
\ No newline at end of file
+}