@Test public void number_format() { DecimalFormatSymbols syms = DecimalFormatSymbols.getInstance(); DoubleOptionFieldAdapter adapter = DoubleOptionFieldAdapter.builder() .withNumberFormat("0.00") .withDecimalFormatSymbols(syms) .build(); checkParse(adapter, 0, new DoubleOption(0)); checkParse(adapter, 1, new DoubleOption(1)); checkParse(adapter, -1, new DoubleOption(-1)); checkParse(adapter, "-0", new DoubleOption(0)); checkParse(adapter, syms.getNaN(), new DoubleOption(Double.NaN)); checkParse(adapter, syms.getInfinity(), new DoubleOption(Double.POSITIVE_INFINITY)); checkParse(adapter, "-" + syms.getInfinity(), new DoubleOption(Double.NEGATIVE_INFINITY)); checkMalformed(adapter, "", new DoubleOption()); checkMalformed(adapter, "Hello, world!", new DoubleOption()); checkEmit(adapter, new DoubleOption(1), "1.00"); checkEmit(adapter, new DoubleOption(-1), "-1.00"); checkEmit(adapter, new DoubleOption(Math.PI), "3.14"); checkEmit(adapter, new DoubleOption(12345), "12345.00"); checkEmit(adapter, new DoubleOption(-0), "0.00"); checkEmit(adapter, new DoubleOption(Double.NaN), syms.getNaN()); checkEmit(adapter, new DoubleOption(Double.POSITIVE_INFINITY), syms.getInfinity()); checkEmit(adapter, new DoubleOption(Double.NEGATIVE_INFINITY), "-" + syms.getInfinity()); }
public static Builder builder() { return new Builder(); }
DoubleOptionFieldAdapter extends NumericOptionFieldAdapter<DoubleOption> { public static Builder builder() { return new Builder(); } }
DoubleOptionFieldAdapter extends NumericOptionFieldAdapter<DoubleOption> { public static Builder builder() { return new Builder(); } DoubleOptionFieldAdapter(String nullFormat, DecimalFormat decimalFormat); }
DoubleOptionFieldAdapter extends NumericOptionFieldAdapter<DoubleOption> { public static Builder builder() { return new Builder(); } DoubleOptionFieldAdapter(String nullFormat, DecimalFormat decimalFormat); static Builder builder(); }
DoubleOptionFieldAdapter extends NumericOptionFieldAdapter<DoubleOption> { public static Builder builder() { return new Builder(); } DoubleOptionFieldAdapter(String nullFormat, DecimalFormat decimalFormat); static Builder builder();  }