@Test public void shouldDecodeValueAsRangeWithBeginningOnlyWhenItsImpossibleToSplitValueUsingSeparators() { BetweenMatcher matcher = new BetweenMatcher(true, true, "~#"); Range<String> decoded = type.decode("A:B", null, matcher); assertThat(decoded.from()).isEqualTo("A:B"); assertThat(decoded.to()).isEqualTo(null); }
@Override public Range<C> decode(String value, Type<?> type, Matcher matcher) { BetweenMatcher betweenMatcher = (BetweenMatcher) matcher; char separator = findSeparator(value, betweenMatcher.separators()); String[] values = EngineUtil.split2(value, separator); String from = values[0].trim(); String to = values[1].trim(); return new Range<C>(decodeValue(from, type), decodeValue(to, type)); }
BetweenMatcherType implements MatcherType<Range<C>> { @Override public Range<C> decode(String value, Type<?> type, Matcher matcher) { BetweenMatcher betweenMatcher = (BetweenMatcher) matcher; char separator = findSeparator(value, betweenMatcher.separators()); String[] values = EngineUtil.split2(value, separator); String from = values[0].trim(); String to = values[1].trim(); return new Range<C>(decodeValue(from, type), decodeValue(to, type)); } }
BetweenMatcherType implements MatcherType<Range<C>> { @Override public Range<C> decode(String value, Type<?> type, Matcher matcher) { BetweenMatcher betweenMatcher = (BetweenMatcher) matcher; char separator = findSeparator(value, betweenMatcher.separators()); String[] values = EngineUtil.split2(value, separator); String from = values[0].trim(); String to = values[1].trim(); return new Range<C>(decodeValue(from, type), decodeValue(to, type)); }  }
BetweenMatcherType implements MatcherType<Range<C>> { @Override public Range<C> decode(String value, Type<?> type, Matcher matcher) { BetweenMatcher betweenMatcher = (BetweenMatcher) matcher; char separator = findSeparator(value, betweenMatcher.separators()); String[] values = EngineUtil.split2(value, separator); String from = values[0].trim(); String to = values[1].trim(); return new Range<C>(decodeValue(from, type), decodeValue(to, type)); }  @Override Range<C> decode(String value, Type<?> type, Matcher matcher); @Override String encode(Range<C> object, Type<?> type, Matcher matcher); }
BetweenMatcherType implements MatcherType<Range<C>> { @Override public Range<C> decode(String value, Type<?> type, Matcher matcher) { BetweenMatcher betweenMatcher = (BetweenMatcher) matcher; char separator = findSeparator(value, betweenMatcher.separators()); String[] values = EngineUtil.split2(value, separator); String from = values[0].trim(); String to = values[1].trim(); return new Range<C>(decodeValue(from, type), decodeValue(to, type)); }  @Override Range<C> decode(String value, Type<?> type, Matcher matcher); @Override String encode(Range<C> object, Type<?> type, Matcher matcher);  }