@Test public void testToStringHex() throws Exception { ObjectReference or = this.getObjectReference("Foo"); Map<String, Object> options = formatter.getDefaultOptions(); options.put(NUMERIC_FORMAT_OPTION, NumericFormatEnum.HEX); assertEquals("Failed to format an object.", String.format("MockType@%#x", or.uniqueID()), formatter.toString(or, options)); }
@Override public String toString(Object obj, Map<String, Object> options) { return String.format("%s@%s", getPrefix((ObjectReference) obj, options), getIdPostfix((ObjectReference) obj, options)); }
ObjectFormatter implements IValueFormatter { @Override public String toString(Object obj, Map<String, Object> options) { return String.format("%s@%s", getPrefix((ObjectReference) obj, options), getIdPostfix((ObjectReference) obj, options)); } }
ObjectFormatter implements IValueFormatter { @Override public String toString(Object obj, Map<String, Object> options) { return String.format("%s@%s", getPrefix((ObjectReference) obj, options), getIdPostfix((ObjectReference) obj, options)); } ObjectFormatter(BiFunction<Type, Map<String, Object>, String> typeToStringFunction); }
ObjectFormatter implements IValueFormatter { @Override public String toString(Object obj, Map<String, Object> options) { return String.format("%s@%s", getPrefix((ObjectReference) obj, options), getIdPostfix((ObjectReference) obj, options)); } ObjectFormatter(BiFunction<Type, Map<String, Object>, String> typeToStringFunction); @Override String toString(Object obj, Map<String, Object> options); @Override boolean acceptType(Type type, Map<String, Object> options); @Override Value valueOf(String value, Type type, Map<String, Object> options); }
ObjectFormatter implements IValueFormatter { @Override public String toString(Object obj, Map<String, Object> options) { return String.format("%s@%s", getPrefix((ObjectReference) obj, options), getIdPostfix((ObjectReference) obj, options)); } ObjectFormatter(BiFunction<Type, Map<String, Object>, String> typeToStringFunction); @Override String toString(Object obj, Map<String, Object> options); @Override boolean acceptType(Type type, Map<String, Object> options); @Override Value valueOf(String value, Type type, Map<String, Object> options);  }