@Test public void testResolve() { MockSpecifierContext ctxt = MockSpecifierContext.builder() .setConfigs( ImmutableMap.of( "node1", new Configuration("node1", ConfigurationFormat.CISCO_IOS), "node2", new Configuration("node2", ConfigurationFormat.CISCO_IOS))) .build(); assertThat(new NameNodeSpecifier("node1").resolve(ctxt), equalTo(ImmutableSet.of("node1"))); assertThat(new NameNodeSpecifier("node").resolve(ctxt), equalTo(ImmutableSet.of())); assertThat(new NameNodeSpecifier("NODE1").resolve(ctxt), equalTo(ImmutableSet.of("node1"))); }
@Override public Set<String> resolve(SpecifierContext ctxt) { return ctxt.getConfigs().keySet().stream() .filter(n -> n.equalsIgnoreCase(_name)) .collect(ImmutableSet.toImmutableSet()); }
NameNodeSpecifier implements NodeSpecifier { @Override public Set<String> resolve(SpecifierContext ctxt) { return ctxt.getConfigs().keySet().stream() .filter(n -> n.equalsIgnoreCase(_name)) .collect(ImmutableSet.toImmutableSet()); } }
NameNodeSpecifier implements NodeSpecifier { @Override public Set<String> resolve(SpecifierContext ctxt) { return ctxt.getConfigs().keySet().stream() .filter(n -> n.equalsIgnoreCase(_name)) .collect(ImmutableSet.toImmutableSet()); } NameNodeSpecifier(String name); }
NameNodeSpecifier implements NodeSpecifier { @Override public Set<String> resolve(SpecifierContext ctxt) { return ctxt.getConfigs().keySet().stream() .filter(n -> n.equalsIgnoreCase(_name)) .collect(ImmutableSet.toImmutableSet()); } NameNodeSpecifier(String name); @Override boolean equals(Object o); @Override int hashCode(); @Override Set<String> resolve(SpecifierContext ctxt); }
NameNodeSpecifier implements NodeSpecifier { @Override public Set<String> resolve(SpecifierContext ctxt) { return ctxt.getConfigs().keySet().stream() .filter(n -> n.equalsIgnoreCase(_name)) .collect(ImmutableSet.toImmutableSet()); } NameNodeSpecifier(String name); @Override boolean equals(Object o); @Override int hashCode(); @Override Set<String> resolve(SpecifierContext ctxt);  }