@Test void shouldParseDateExpressionsInRange() { final FeelExpression expression = FeelParser.PARSER.parse( "[date and time(\"2015-11-30T12:00:00\")..date and time(\"2015-12-01T12:00:00\")]"); final FeelExpression expectedExpression = RangeExpression(true, DateLiteral(LocalDateTime.of(2015, Month.NOVEMBER, 30, 12, 0)), DateLiteral(LocalDateTime.of(2015, Month.DECEMBER, 1, 12, 0)), true); assertEquals(expectedExpression, expression); }
public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage())); } }
FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage())); } } }
FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage())); } } private  FeelParser(); }
FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage())); } } private  FeelParser(); static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence); }
FeelParser { public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence) { try { return Eithers.right(PARSER.parse(charSequence)); } catch (final ParserException e) { return Eithers.left(ValidationResult.init.message("Could not parse '" + charSequence + "': " + e.getMessage())); } } private  FeelParser(); static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final CharSequence charSequence);  }