@Test(expected = UnsupportedOperationException.class) public void testToStringNotSupported() { ObjectReference or = this.getObjectReference("Foo"); formatter.toString(or, new HashMap<>()); fail("format object should not be supported by numeric formatter."); }
@Override public String toString(Object obj, Map<String, Object> options) { Value value = (Value) obj; char signature0 = value.type().signature().charAt(0); if (signature0 == LONG || signature0 == INT || signature0 == SHORT || signature0 == BYTE) { return formatNumber(Long.parseLong(value.toString()), options); } else if (hasFraction(signature0)) { return formatFloatDouble(Double.parseDouble(value.toString()), options); } throw new UnsupportedOperationException(String.format("%s is not a numeric type.", value.type().name())); }
NumericFormatter implements IValueFormatter { @Override public String toString(Object obj, Map<String, Object> options) { Value value = (Value) obj; char signature0 = value.type().signature().charAt(0); if (signature0 == LONG || signature0 == INT || signature0 == SHORT || signature0 == BYTE) { return formatNumber(Long.parseLong(value.toString()), options); } else if (hasFraction(signature0)) { return formatFloatDouble(Double.parseDouble(value.toString()), options); } throw new UnsupportedOperationException(String.format("%s is not a numeric type.", value.type().name())); } }
NumericFormatter implements IValueFormatter { @Override public String toString(Object obj, Map<String, Object> options) { Value value = (Value) obj; char signature0 = value.type().signature().charAt(0); if (signature0 == LONG || signature0 == INT || signature0 == SHORT || signature0 == BYTE) { return formatNumber(Long.parseLong(value.toString()), options); } else if (hasFraction(signature0)) { return formatFloatDouble(Double.parseDouble(value.toString()), options); } throw new UnsupportedOperationException(String.format("%s is not a numeric type.", value.type().name())); }  }
NumericFormatter implements IValueFormatter { @Override public String toString(Object obj, Map<String, Object> options) { Value value = (Value) obj; char signature0 = value.type().signature().charAt(0); if (signature0 == LONG || signature0 == INT || signature0 == SHORT || signature0 == BYTE) { return formatNumber(Long.parseLong(value.toString()), options); } else if (hasFraction(signature0)) { return formatFloatDouble(Double.parseDouble(value.toString()), options); } throw new UnsupportedOperationException(String.format("%s is not a numeric type.", value.type().name())); }  @Override String toString(Object obj, Map<String, Object> options); @Override Value valueOf(String value, Type type, Map<String, Object> options); @Override boolean acceptType(Type type, Map<String, Object> options); @Override Map<String, Object> getDefaultOptions(); }
NumericFormatter implements IValueFormatter { @Override public String toString(Object obj, Map<String, Object> options) { Value value = (Value) obj; char signature0 = value.type().signature().charAt(0); if (signature0 == LONG || signature0 == INT || signature0 == SHORT || signature0 == BYTE) { return formatNumber(Long.parseLong(value.toString()), options); } else if (hasFraction(signature0)) { return formatFloatDouble(Double.parseDouble(value.toString()), options); } throw new UnsupportedOperationException(String.format("%s is not a numeric type.", value.type().name())); }  @Override String toString(Object obj, Map<String, Object> options); @Override Value valueOf(String value, Type type, Map<String, Object> options); @Override boolean acceptType(Type type, Map<String, Object> options); @Override Map<String, Object> getDefaultOptions(); static final String NUMERIC_FORMAT_OPTION; static final String NUMERIC_PRECISION_OPTION; }