Add byte[] as a type that we can getAsString

This commit is contained in:
2023-11-30 19:56:55 -06:00
parent 191bcdf0dd
commit 94fcc36c64
2 changed files with 5 additions and 0 deletions

View File

@ -69,6 +69,10 @@ public class ValueUtils
{
return (s);
}
else if(value instanceof byte[] ba)
{
return (new String(ba));
}
else
{
return (String.valueOf(value));

View File

@ -68,6 +68,7 @@ class ValueUtilsTest extends BaseTest
assertEquals("1", ValueUtils.getValueAsString(1));
assertEquals("1", ValueUtils.getValueAsString(1));
assertEquals("1.10", ValueUtils.getValueAsString(new BigDecimal("1.10")));
assertEquals("ABC", ValueUtils.getValueAsString(new byte[] { 65, 66, 67 }));
}