@Test public void testGetCapabilities() throws Exception { Capabilities capabilities = Configuration.getCapabilities(Version.Version1); assertTrue(capabilities.getCapability().contains(CapabilityType.Ipv4Unicast)); capabilities = Configuration.getCapabilities(Version.Version2); assertTrue(capabilities.getCapability().contains(CapabilityType.Ipv4Unicast)); assertTrue(capabilities.getCapability().contains(CapabilityType.Ipv6Unicast)); capabilities = Configuration.getCapabilities(Version.Version3); assertTrue(capabilities.getCapability().contains(CapabilityType.Ipv4Unicast)); assertTrue(capabilities.getCapability().contains(CapabilityType.Ipv6Unicast)); assertTrue(capabilities.getCapability().contains(CapabilityType.SubnetBindings)); capabilities = Configuration.getCapabilities(Version.Version4); assertTrue(capabilities.getCapability().contains(CapabilityType.Ipv4Unicast)); assertTrue(capabilities.getCapability().contains(CapabilityType.Ipv6Unicast)); assertTrue(capabilities.getCapability().contains(CapabilityType.SubnetBindings)); assertTrue(capabilities.getCapability().contains(CapabilityType.SxpCapabilityExchange)); assertTrue(capabilities.getCapability().contains(CapabilityType.LoopDetection)); }
public static Capabilities getCapabilities(final Version version) { final CapabilitiesBuilder capabilitiesBuilder = new CapabilitiesBuilder(); final List<CapabilityType> capabilities = new ArrayList<>(); if (version.getIntValue() >= Version.Version1.getIntValue()) { capabilities.add(CapabilityType.Ipv4Unicast); if (version.getIntValue() >= Version.Version2.getIntValue()) { capabilities.add(CapabilityType.Ipv6Unicast); if (version.getIntValue() >= Version.Version3.getIntValue()) { capabilities.add(CapabilityType.SubnetBindings); if (version.getIntValue() >= Version.Version4.getIntValue()) { capabilities.add(CapabilityType.LoopDetection); capabilities.add(CapabilityType.SxpCapabilityExchange); } } } } if (capabilities.isEmpty()) { capabilities.add(CapabilityType.None); } capabilitiesBuilder.setCapability(capabilities); return capabilitiesBuilder.build(); }
Configuration { public static Capabilities getCapabilities(final Version version) { final CapabilitiesBuilder capabilitiesBuilder = new CapabilitiesBuilder(); final List<CapabilityType> capabilities = new ArrayList<>(); if (version.getIntValue() >= Version.Version1.getIntValue()) { capabilities.add(CapabilityType.Ipv4Unicast); if (version.getIntValue() >= Version.Version2.getIntValue()) { capabilities.add(CapabilityType.Ipv6Unicast); if (version.getIntValue() >= Version.Version3.getIntValue()) { capabilities.add(CapabilityType.SubnetBindings); if (version.getIntValue() >= Version.Version4.getIntValue()) { capabilities.add(CapabilityType.LoopDetection); capabilities.add(CapabilityType.SxpCapabilityExchange); } } } } if (capabilities.isEmpty()) { capabilities.add(CapabilityType.None); } capabilitiesBuilder.setCapability(capabilities); return capabilitiesBuilder.build(); } }
Configuration { public static Capabilities getCapabilities(final Version version) { final CapabilitiesBuilder capabilitiesBuilder = new CapabilitiesBuilder(); final List<CapabilityType> capabilities = new ArrayList<>(); if (version.getIntValue() >= Version.Version1.getIntValue()) { capabilities.add(CapabilityType.Ipv4Unicast); if (version.getIntValue() >= Version.Version2.getIntValue()) { capabilities.add(CapabilityType.Ipv6Unicast); if (version.getIntValue() >= Version.Version3.getIntValue()) { capabilities.add(CapabilityType.SubnetBindings); if (version.getIntValue() >= Version.Version4.getIntValue()) { capabilities.add(CapabilityType.LoopDetection); capabilities.add(CapabilityType.SxpCapabilityExchange); } } } } if (capabilities.isEmpty()) { capabilities.add(CapabilityType.None); } capabilitiesBuilder.setCapability(capabilities); return capabilitiesBuilder.build(); } private  Configuration(); }
Configuration { public static Capabilities getCapabilities(final Version version) { final CapabilitiesBuilder capabilitiesBuilder = new CapabilitiesBuilder(); final List<CapabilityType> capabilities = new ArrayList<>(); if (version.getIntValue() >= Version.Version1.getIntValue()) { capabilities.add(CapabilityType.Ipv4Unicast); if (version.getIntValue() >= Version.Version2.getIntValue()) { capabilities.add(CapabilityType.Ipv6Unicast); if (version.getIntValue() >= Version.Version3.getIntValue()) { capabilities.add(CapabilityType.SubnetBindings); if (version.getIntValue() >= Version.Version4.getIntValue()) { capabilities.add(CapabilityType.LoopDetection); capabilities.add(CapabilityType.SxpCapabilityExchange); } } } } if (capabilities.isEmpty()) { capabilities.add(CapabilityType.None); } capabilitiesBuilder.setCapability(capabilities); return capabilitiesBuilder.build(); } private  Configuration(); static Capabilities getCapabilities(final Version version); }
Configuration { public static Capabilities getCapabilities(final Version version) { final CapabilitiesBuilder capabilitiesBuilder = new CapabilitiesBuilder(); final List<CapabilityType> capabilities = new ArrayList<>(); if (version.getIntValue() >= Version.Version1.getIntValue()) { capabilities.add(CapabilityType.Ipv4Unicast); if (version.getIntValue() >= Version.Version2.getIntValue()) { capabilities.add(CapabilityType.Ipv6Unicast); if (version.getIntValue() >= Version.Version3.getIntValue()) { capabilities.add(CapabilityType.SubnetBindings); if (version.getIntValue() >= Version.Version4.getIntValue()) { capabilities.add(CapabilityType.LoopDetection); capabilities.add(CapabilityType.SxpCapabilityExchange); } } } } if (capabilities.isEmpty()) { capabilities.add(CapabilityType.None); } capabilitiesBuilder.setCapability(capabilities); return capabilitiesBuilder.build(); } private  Configuration(); static Capabilities getCapabilities(final Version version); static final String TOPOLOGY_NAME; static final int DEFAULT_PREFIX_GROUP; static final int NETTY_CONNECT_TIMEOUT_MILLIS; static final boolean NETTY_LOGGER_HANDLER; static final boolean SET_COMPOSITION_ATTRIBUTE_COMPACT_NO_RESERVED_FIELDS; }