public class Utils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static double |
DOUBLE_COMPARISON_MAX_DIFFERENCE_ALLOWED
When comparing doubles, we consider them equal if the difference between them is inferior
to this value.
|
private static int |
NUM_BYTES_IN_DOUBLE |
private static int |
NUM_BYTES_IN_INT |
Modifier | Constructor and Description |
---|---|
private |
Utils()
Utility class: should not be instantiated
|
Modifier and Type | Method and Description |
---|---|
static double |
bytesToDouble(byte[] bytes) |
static int |
bytesToInt(byte[] bytes) |
static void |
copyIntoStreamIntoAnother(java.io.InputStream inputStream,
java.io.OutputStream outputStream) |
static boolean |
equalsDouble(double a,
double b) |
static boolean |
fileExists(java.io.File file) |
static boolean |
hasSpecialChar(java.lang.String string)
Returns whether the string contains a special character.
|
static <T> boolean |
listsHaveSameElements(java.util.List<T> list1,
java.util.List<T> list2) |
static double |
round(double value,
int precision) |
static void |
setupKeyStore() |
static byte[] |
toByteArray(double value) |
static byte[] |
toByteArray(int value) |
public static final double DOUBLE_COMPARISON_MAX_DIFFERENCE_ALLOWED
private static final int NUM_BYTES_IN_INT
private static final int NUM_BYTES_IN_DOUBLE
public static boolean equalsDouble(double a, double b)
public static boolean hasSpecialChar(java.lang.String string)
string
- public static double round(double value, int precision)
public static byte[] toByteArray(int value)
public static byte[] toByteArray(double value)
public static int bytesToInt(byte[] bytes)
public static double bytesToDouble(byte[] bytes)
public static <T> boolean listsHaveSameElements(java.util.List<T> list1, java.util.List<T> list2)
public static void setupKeyStore() throws java.io.IOException
java.io.IOException
public static void copyIntoStreamIntoAnother(java.io.InputStream inputStream, java.io.OutputStream outputStream) throws java.io.IOException
java.io.IOException
public static boolean fileExists(java.io.File file)