@Test public void props() { PropFileChain chain = new PropFileChain(Collections.<Context, PropFileChain>emptyMap()); PropFile.Prop empty = chain.get("test"); assertSame(PropFile.Prop.Empty, empty); Iterable<PropFile.Prop> iter = chain.props(); assertFalse(iter.iterator().hasNext()); assertSame(PropFile.Prop.Empty, iter.iterator().next()); PropFile systemFile = new PropFile(Context.named("test"), PropFile.Loc.System); PropFile.Prop systemTestProp = systemFile.add("test", "system-value"); chain.set(systemFile, PropFile.Loc.System); iter = chain.props(); Iterator<PropFile.Prop> iterator = iter.iterator(); assertTrue(iterator.hasNext()); assertEquals(systemTestProp, iterator.next()); assertFalse(iterator.hasNext()); PropFile localFile = new PropFile(Context.named("test"), PropFile.Loc.Local); PropFile.Prop localTestProp = localFile.add("test", "local-value"); PropFile.Prop localAnotherProp = localFile.add("another", "local-another-value"); chain.set(localFile, PropFile.Loc.Local); iter = chain.props(); iterator = iter.iterator(); assertTrue(iterator.hasNext()); assertEquals(localTestProp, iterator.next()); assertTrue(iterator.hasNext()); assertEquals(localAnotherProp, iterator.next()); assertFalse(iterator.hasNext()); PropFileChain scopedChain = new PropFileChain(chain, Collections.<Context, PropFileChain>emptyMap()); PropFile localScopedFile = new PropFile(Context.named("test"), Scope.named("test"), PropFile.Loc.Local); PropFile.Prop localScopedTestProp = localFile.add("test", "local-test-value"); scopedChain.set(localScopedFile, PropFile.Loc.Local); iter = scopedChain.props(); iterator = iter.iterator(); assertTrue(iterator.hasNext()); assertEquals(localScopedTestProp, iterator.next()); assertTrue(iterator.hasNext()); assertEquals(localAnotherProp, iterator.next()); assertFalse(iterator.hasNext()); }
public final Iterable<PropFile.Prop> props() { return props; }
PropFileChain { public final Iterable<PropFile.Prop> props() { return props; } }
PropFileChain { public final Iterable<PropFile.Prop> props() { return props; } PropFileChain(Map<Context, PropFileChain> filterConsultant);   PropFileChain(PropFileChain defaultChain, Map<Context, PropFileChain> filterConsultant); private  PropFileChain(Impl defaultChain, Map<Context, PropFileChain> filterConsultant); }
PropFileChain { public final Iterable<PropFile.Prop> props() { return props; } PropFileChain(Map<Context, PropFileChain> filterConsultant);   PropFileChain(PropFileChain defaultChain, Map<Context, PropFileChain> filterConsultant); private  PropFileChain(Impl defaultChain, Map<Context, PropFileChain> filterConsultant); PropFile.Prop get(String named); final Iterable<PropFile.Prop> props(); }
PropFileChain { public final Iterable<PropFile.Prop> props() { return props; } PropFileChain(Map<Context, PropFileChain> filterConsultant);   PropFileChain(PropFileChain defaultChain, Map<Context, PropFileChain> filterConsultant); private  PropFileChain(Impl defaultChain, Map<Context, PropFileChain> filterConsultant); PropFile.Prop get(String named); final Iterable<PropFile.Prop> props();  }