@Test public void testGetContainedAtomsAllAtomicValues() { assertThat( getContainedAtoms(RoutingProtocolSpecifier.OSPF_INT), equalTo( ImmutableSet.of( RoutingProtocolSpecifier.OSPF_INTER, RoutingProtocolSpecifier.OSPF_INTRA))); assertThat( getContainedAtoms(RoutingProtocolSpecifier.OSPF), equalTo( ImmutableSet.of( RoutingProtocolSpecifier.OSPF_EXT1, RoutingProtocolSpecifier.OSPF_EXT2, RoutingProtocolSpecifier.OSPF_INTER, RoutingProtocolSpecifier.OSPF_INTRA))); }
@VisibleForTesting static Set<String> getContainedAtoms(String protocol) { return MAP.entrySet().stream() .filter(e -> !e.getKey().equals(protocol)) .filter(e -> ATOMIC_VALUES.contains(e.getKey())) .filter(e -> Sets.difference(e.getValue(), MAP.get(protocol)).isEmpty()) .map(Entry::getKey) .collect(ImmutableSet.toImmutableSet()); }
RoutingProtocolSpecifier { @VisibleForTesting static Set<String> getContainedAtoms(String protocol) { return MAP.entrySet().stream() .filter(e -> !e.getKey().equals(protocol)) .filter(e -> ATOMIC_VALUES.contains(e.getKey())) .filter(e -> Sets.difference(e.getValue(), MAP.get(protocol)).isEmpty()) .map(Entry::getKey) .collect(ImmutableSet.toImmutableSet()); } }
RoutingProtocolSpecifier { @VisibleForTesting static Set<String> getContainedAtoms(String protocol) { return MAP.entrySet().stream() .filter(e -> !e.getKey().equals(protocol)) .filter(e -> ATOMIC_VALUES.contains(e.getKey())) .filter(e -> Sets.difference(e.getValue(), MAP.get(protocol)).isEmpty()) .map(Entry::getKey) .collect(ImmutableSet.toImmutableSet()); } RoutingProtocolSpecifier(String text); }
RoutingProtocolSpecifier { @VisibleForTesting static Set<String> getContainedAtoms(String protocol) { return MAP.entrySet().stream() .filter(e -> !e.getKey().equals(protocol)) .filter(e -> ATOMIC_VALUES.contains(e.getKey())) .filter(e -> Sets.difference(e.getValue(), MAP.get(protocol)).isEmpty()) .map(Entry::getKey) .collect(ImmutableSet.toImmutableSet()); } RoutingProtocolSpecifier(String text); @JsonValue @Nonnull String value(); @JsonIgnore static Set<String> getAllProtocolKeys(); @JsonIgnore static Set<String> getAtomicProtocols(); @JsonIgnore static Map<String, Set<String>> getGroupings(); Set<RoutingProtocol> getProtocols(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
RoutingProtocolSpecifier { @VisibleForTesting static Set<String> getContainedAtoms(String protocol) { return MAP.entrySet().stream() .filter(e -> !e.getKey().equals(protocol)) .filter(e -> ATOMIC_VALUES.contains(e.getKey())) .filter(e -> Sets.difference(e.getValue(), MAP.get(protocol)).isEmpty()) .map(Entry::getKey) .collect(ImmutableSet.toImmutableSet()); } RoutingProtocolSpecifier(String text); @JsonValue @Nonnull String value(); @JsonIgnore static Set<String> getAllProtocolKeys(); @JsonIgnore static Set<String> getAtomicProtocols(); @JsonIgnore static Map<String, Set<String>> getGroupings(); Set<RoutingProtocol> getProtocols(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final String ALL; static final String AGGREGATE; static final String BGP; static final String CONNECTED; static final String EBGP; static final String EIGRP; static final String EIGRP_EXT; static final String EIGRP_INT; static final String IBGP; static final String IGP; static final String ISIS; static final String ISIS_L1; static final String ISIS_L2; static final String ISIS_EL1; static final String ISIS_EL2; static final String LOCAL; static final String OSPF; static final String OSPF_EXT; static final String OSPF_EXT1; static final String OSPF_EXT2; static final String OSPF_INT; static final String OSPF_INTER; static final String OSPF_INTRA; static final String RIP; static final String STATIC; static final RoutingProtocolSpecifier ALL_PROTOCOLS_SPECIFIER; }