From 2c10d24ca7a6409431cc457b36ec1fa6193d553c Mon Sep 17 00:00:00 2001 From: Jakob Braun Date: Tue, 11 Aug 2020 11:17:38 +0200 Subject: [PATCH] #87 added missing function to BigDecimalLiteral --- .../com/exasol/sql/expression/BigDecimalLiteral.java | 9 +++++++++ .../com/exasol/sql/expression/TestBigDecimalLiteral.java | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/src/main/java/com/exasol/sql/expression/BigDecimalLiteral.java b/src/main/java/com/exasol/sql/expression/BigDecimalLiteral.java index 790d30cc..dc12d42b 100644 --- a/src/main/java/com/exasol/sql/expression/BigDecimalLiteral.java +++ b/src/main/java/com/exasol/sql/expression/BigDecimalLiteral.java @@ -23,6 +23,15 @@ public static BigDecimalLiteral of(BigDecimal literal) { return new BigDecimalLiteral(literal); } + /** + * Get the value of the {@link BigDecimalLiteral}. + * + * @return BigDecimal value + */ + public BigDecimal getValue() { + return literal; + } + @Override public void accept(ValueExpressionVisitor visitor) { visitor.visit(this); diff --git a/src/test/java/com/exasol/sql/expression/TestBigDecimalLiteral.java b/src/test/java/com/exasol/sql/expression/TestBigDecimalLiteral.java index 764149d5..279c9e40 100644 --- a/src/test/java/com/exasol/sql/expression/TestBigDecimalLiteral.java +++ b/src/test/java/com/exasol/sql/expression/TestBigDecimalLiteral.java @@ -9,6 +9,11 @@ // [utest->dsn~literal-values~1] class TestBigDecimalLiteral { + @Test + void testGetValue() { + assertThat(BigDecimalLiteral.of(BigDecimal.TEN).getValue(), equalTo(BigDecimal.TEN)); + } + @Test void testGetToString() { assertThat(BigDecimalLiteral.of(BigDecimal.valueOf(123)).toString(), equalTo("123"));