@Test public void testQueryAllValuesTwoWithSamePriority() throws Exception { MockApplicableRegionSet mock = new MockApplicableRegionSet(); StringFlag stringFlag1 = new StringFlag("string1"); StringFlag stringFlag2 = new StringFlag("string2"); ProtectedRegion region = mock.add(0); region.setFlag(stringFlag1, "test1"); region = mock.add(0); region.setFlag(stringFlag1, "test2"); FlagValueCalculator result = mock.getFlagCalculator(); assertThat(copyOf(result.queryAllValues(null, stringFlag1)), equalTo(of("test1", "test2"))); assertThat(result.queryAllValues(null, stringFlag2), is(Matchers.<String>empty())); }
public <V> Collection<V> queryAllValues(@Nullable RegionAssociable subject, Flag<V> flag) { return queryAllValues(subject, flag, false); }
FlagValueCalculator { public <V> Collection<V> queryAllValues(@Nullable RegionAssociable subject, Flag<V> flag) { return queryAllValues(subject, flag, false); } }
FlagValueCalculator { public <V> Collection<V> queryAllValues(@Nullable RegionAssociable subject, Flag<V> flag) { return queryAllValues(subject, flag, false); } FlagValueCalculator(List<ProtectedRegion> regions, @Nullable ProtectedRegion globalRegion); }
FlagValueCalculator { public <V> Collection<V> queryAllValues(@Nullable RegionAssociable subject, Flag<V> flag) { return queryAllValues(subject, flag, false); } FlagValueCalculator(List<ProtectedRegion> regions, @Nullable ProtectedRegion globalRegion); Result getMembership(RegionAssociable subject); @Nullable State queryState(@Nullable RegionAssociable subject, StateFlag... flags); @Nullable State queryState(@Nullable RegionAssociable subject, StateFlag flag); @Nullable V queryValue(@Nullable RegionAssociable subject, Flag<V> flag); Collection<V> queryAllValues(@Nullable RegionAssociable subject, Flag<V> flag); int getPriority(final ProtectedRegion region); @SuppressWarnings("unchecked") V getEffectiveFlag(final ProtectedRegion region, Flag<V> flag, @Nullable RegionAssociable subject); }
FlagValueCalculator { public <V> Collection<V> queryAllValues(@Nullable RegionAssociable subject, Flag<V> flag) { return queryAllValues(subject, flag, false); } FlagValueCalculator(List<ProtectedRegion> regions, @Nullable ProtectedRegion globalRegion); Result getMembership(RegionAssociable subject); @Nullable State queryState(@Nullable RegionAssociable subject, StateFlag... flags); @Nullable State queryState(@Nullable RegionAssociable subject, StateFlag flag); @Nullable V queryValue(@Nullable RegionAssociable subject, Flag<V> flag); Collection<V> queryAllValues(@Nullable RegionAssociable subject, Flag<V> flag); int getPriority(final ProtectedRegion region); @SuppressWarnings("unchecked") V getEffectiveFlag(final ProtectedRegion region, Flag<V> flag, @Nullable RegionAssociable subject);  }