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