public final class GenericUtils
extends java.lang.Object
Class with generic utilities.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
| Modifier and Type | Method and Description |
|---|---|
static boolean |
assertArrayValid(byte[] data)
Asserts whether a array is valid (not null and not empty).
|
static boolean |
assertStringValue(java.lang.String value)
Asserts whether a value is valid (not null or not empty).
|
static boolean |
checkNullValues(java.lang.Object... values)
Checks if a value is null.
|
static byte[] |
getDataFromInputStream(java.io.InputStream input)
Reads and converts a bytes stream to byte array.
|
static java.lang.String |
getValueFromMapsTree(java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object> treeValues)
Retrieves a value from a tree of several maps by a path given.
|
static void |
printResult(byte[] result,
Logger logger)
Prints the resulting data in base64 format.
|
public static boolean assertStringValue(java.lang.String value)
value - string to validate.public static boolean assertArrayValid(byte[] data)
data - array to validate.public static java.lang.String getValueFromMapsTree(java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object> treeValues)
path - path of maps tree separated by '/'.treeValues - collection of maps (type: Mappublic static byte[] getDataFromInputStream(java.io.InputStream input)
throws java.io.IOException
input - input stream to convert.java.io.IOException - If the first byte cannot be read for any reason other than the end of the file, if the input stream has been closed,
or if some other I/O error occurs.public static boolean checkNullValues(java.lang.Object... values)
values - collection of values to validate.public static void printResult(byte[] result,
Logger logger)
result - result bytes.logger - logger object used for print.