@Test public void parse_predicate() { BooleanOptionFieldAdapter adapter = BooleanOptionFieldAdapter.builder() .withTrueFormat("T", s -> s.length() > 0 && "F".contentEquals(s) == false) .withFalseFormat("F", s -> s.length() == 0 || "F".contentEquals(s)) .build(); checkParse(adapter, "F", new BooleanOption(false)); checkParse(adapter, "T", new BooleanOption(true)); checkParse(adapter, "", new BooleanOption(false)); checkParse(adapter, "abc", new BooleanOption(true)); checkParse(adapter, "true", new BooleanOption(true)); checkParse(adapter, "false", new BooleanOption(true)); }
public static Builder builder() { return new Builder(); }
BooleanOptionFieldAdapter extends ValueOptionFieldAdapter<BooleanOption> { public static Builder builder() { return new Builder(); } }
BooleanOptionFieldAdapter extends ValueOptionFieldAdapter<BooleanOption> { public static Builder builder() { return new Builder(); } BooleanOptionFieldAdapter(
            String nullFormat,
            Predicate<? super CharSequence> trueTester, Predicate<? super CharSequence> falseTester,
            String trueFormat, String falseFormat); }
BooleanOptionFieldAdapter extends ValueOptionFieldAdapter<BooleanOption> { public static Builder builder() { return new Builder(); } BooleanOptionFieldAdapter(
            String nullFormat,
            Predicate<? super CharSequence> trueTester, Predicate<? super CharSequence> falseTester,
            String trueFormat, String falseFormat); static Builder builder(); }
BooleanOptionFieldAdapter extends ValueOptionFieldAdapter<BooleanOption> { public static Builder builder() { return new Builder(); } BooleanOptionFieldAdapter(
            String nullFormat,
            Predicate<? super CharSequence> trueTester, Predicate<? super CharSequence> falseTester,
            String trueFormat, String falseFormat); static Builder builder(); static final String DEFAULT_TRUE_FORMAT; static final String DEFAULT_FALSE_FORMAT; }