@Test public void shouldEncodeValueAsEmptyStringWhenNoTypeAndValueIsNull() { String encoded = type.encode(null, null, null); assertThat(encoded).isEqualTo(""); }
@Override @SuppressWarnings("unchecked") public String encode(Object object, Type type, Matcher matcher) { if (object instanceof Star) { return "*"; } String value; if (type != null) { value = type.encode(type.convert(object)); } else { value = object == null ? "" : object.toString(); } return value == null ? "*" : value; }
SimpleMatcherType implements MatcherType<Object> { @Override @SuppressWarnings("unchecked") public String encode(Object object, Type type, Matcher matcher) { if (object instanceof Star) { return "*"; } String value; if (type != null) { value = type.encode(type.convert(object)); } else { value = object == null ? "" : object.toString(); } return value == null ? "*" : value; } }
SimpleMatcherType implements MatcherType<Object> { @Override @SuppressWarnings("unchecked") public String encode(Object object, Type type, Matcher matcher) { if (object instanceof Star) { return "*"; } String value; if (type != null) { value = type.encode(type.convert(object)); } else { value = object == null ? "" : object.toString(); } return value == null ? "*" : value; }  }
SimpleMatcherType implements MatcherType<Object> { @Override @SuppressWarnings("unchecked") public String encode(Object object, Type type, Matcher matcher) { if (object instanceof Star) { return "*"; } String value; if (type != null) { value = type.encode(type.convert(object)); } else { value = object == null ? "" : object.toString(); } return value == null ? "*" : value; }  @Override Object decode(String value, Type<?> type, Matcher matcher); @Override @SuppressWarnings("unchecked") String encode(Object object, Type type, Matcher matcher); }
SimpleMatcherType implements MatcherType<Object> { @Override @SuppressWarnings("unchecked") public String encode(Object object, Type type, Matcher matcher) { if (object instanceof Star) { return "*"; } String value; if (type != null) { value = type.encode(type.convert(object)); } else { value = object == null ? "" : object.toString(); } return value == null ? "*" : value; }  @Override Object decode(String value, Type<?> type, Matcher matcher); @Override @SuppressWarnings("unchecked") String encode(Object object, Type type, Matcher matcher);  }