Skip to content

Commit

Permalink
Update PathTypeConversion.java
Browse files Browse the repository at this point in the history
  • Loading branch information
SentryMan committed Sep 13, 2023
1 parent 3ce25fb commit 5b0c0a0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions http-api/src/main/java/io/avaje/http/api/PathTypeConversion.java
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,20 @@ public static BigDecimal toBigDecimal(String value) {
}
}

/**
* Convert to BigInteger (allowing nulls).
*/
public static BigInteger toBigInteger(String value) {
if (isNullOrEmpty(value)) {
return null;
}
try {
return new BigInteger(value);
} catch (Exception e) {
throw new InvalidTypeArgumentException(e);
}
}

/**
* Convert to Boolean (allowing nulls).
*/
Expand Down

0 comments on commit 5b0c0a0

Please sign in to comment.