@Test public void testValueOfNull() throws Exception { ObjectReference or = this.getObjectReference("Foo"); assertNull("Should return null for evaluating \"null\".", formatter.valueOf("null", or.referenceType(), new HashMap<>())); assertNull("Should return null for evaluating null.", formatter.valueOf(null, or.referenceType(), new HashMap<>())); }
@Override public Value valueOf(String value, Type type, Map<String, Object> options) { if (value == null || NullObjectFormatter.NULL_STRING.equals(value)) { return null; } throw new UnsupportedOperationException(String.format("Set value is not supported yet for type %s.", type.name())); }
ObjectFormatter implements IValueFormatter { @Override public Value valueOf(String value, Type type, Map<String, Object> options) { if (value == null || NullObjectFormatter.NULL_STRING.equals(value)) { return null; } throw new UnsupportedOperationException(String.format("Set value is not supported yet for type %s.", type.name())); } }
ObjectFormatter implements IValueFormatter { @Override public Value valueOf(String value, Type type, Map<String, Object> options) { if (value == null || NullObjectFormatter.NULL_STRING.equals(value)) { return null; } throw new UnsupportedOperationException(String.format("Set value is not supported yet for type %s.", type.name())); } ObjectFormatter(BiFunction<Type, Map<String, Object>, String> typeToStringFunction); }
ObjectFormatter implements IValueFormatter { @Override public Value valueOf(String value, Type type, Map<String, Object> options) { if (value == null || NullObjectFormatter.NULL_STRING.equals(value)) { return null; } throw new UnsupportedOperationException(String.format("Set value is not supported yet for type %s.", type.name())); } 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 Value valueOf(String value, Type type, Map<String, Object> options) { if (value == null || NullObjectFormatter.NULL_STRING.equals(value)) { return null; } throw new UnsupportedOperationException(String.format("Set value is not supported yet for type %s.", type.name())); } 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);  }