private static List<ExtensionList> getExistingGeneralAugMatchNodesNodeTableFlow(MatchBuilder match) { ArrayList<ExtensionList> extensions = new ArrayList<>(); if (match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class) != null) { List<ExtensionList> existingExtensions = match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class).getExtensionList(); if (existingExtensions != null && !existingExtensions.isEmpty()) { extensions.addAll(existingExtensions); } } return extensions; }
private static void addExtension (MatchBuilder match, Class<? extends ExtensionKey> extensionKey, NxAugMatchNodesNodeTableFlow am) { GeneralAugMatchNodesNodeTableFlow existingAugmentations = match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class); List<ExtensionList> extensions = null; if (existingAugmentations != null ) { extensions = existingAugmentations.getExtensionList(); } if (extensions == null) { extensions = Lists.newArrayList(); } extensions.add(new ExtensionListBuilder() .setExtensionKey(extensionKey) .setExtension(new ExtensionBuilder() .addAugmentation(NxAugMatchNodesNodeTableFlow.class, am) .build()) .build()); GeneralAugMatchNodesNodeTableFlow m = new GeneralAugMatchNodesNodeTableFlowBuilder() .setExtensionList(extensions) .build(); match.addAugmentation(GeneralAugMatchNodesNodeTableFlow.class, m); }
private static void addExtension(MatchBuilder matchBuilder, Class<? extends ExtensionKey> extensionKey, NxAugMatchNodesNodeTableFlow am) { GeneralAugMatchNodesNodeTableFlow existingAugmentations = matchBuilder.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class); List<ExtensionList> extensions = null; if (existingAugmentations != null ) { extensions = existingAugmentations.getExtensionList(); } if (extensions == null) { extensions = Lists.newArrayList(); } extensions.add(new ExtensionListBuilder() .setExtensionKey(extensionKey) .setExtension(new ExtensionBuilder() .addAugmentation(NxAugMatchNodesNodeTableFlow.class, am) .build()) .build()); GeneralAugMatchNodesNodeTableFlow m = new GeneralAugMatchNodesNodeTableFlowBuilder() .setExtensionList(extensions) .build(); matchBuilder.addAugmentation(GeneralAugMatchNodesNodeTableFlow.class, m); }