Skip to content

Commit

Permalink
#87 added missing function to BigDecimalLiteral
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobbraun committed Aug 11, 2020
1 parent fd79eb9 commit 2c10d24
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down

0 comments on commit 2c10d24

Please sign in to comment.