public static boolean isPlotFlagTrue(final Plot plot, final String strFlag) { if (plot.owner == null) { return false; } final Flag flag = getPlotFlagRaw(plot, strFlag); return !(flag == null || !((Boolean) flag.getValue())); }
public static boolean isBooleanFlag( final Plot plot, final String key, final boolean defaultValue) { final Flag flag = FlagManager.getPlotFlagRaw(plot, key); if (flag == null) { return defaultValue; } final Object value = flag.getValue(); if (value instanceof Boolean) { return (boolean) value; } return defaultValue; }
@Test public void foreach_A$VoidFunction1() throws Exception { final Flag flag = new Flag(); int value = 1; Some<Integer> target = new Some<Integer>(value); target.foreach( new VoidF1<Integer>() { public void apply(Integer arg) { flag.toggle(); } }); assertTrue(flag.getValue()); }
static { for (Flag s : EnumSet.allOf(Flag.class)) lookup.put(s.getValue(), s); }
public boolean isFlagSet(Flag flag) { return getFlag(flag.getValue()); }
public void setFlag(Flag flag) { setFlag(flag.getValue()); }