use of org.neo4j.exceptions.TemporalParseException in project neo4j by neo4j.
the class TemporalValue method parse.
static <VALUE> VALUE parse(Class<VALUE> type, Pattern pattern, Function<Matcher, VALUE> parser, CharSequence text) {
Matcher matcher = pattern.matcher(text);
VALUE result = matcher.matches() ? parser.apply(matcher) : null;
if (result == null) {
throw new TemporalParseException("Text cannot be parsed to a " + valueName(type), text.toString(), 0);
}
return result;
}
Aggregations