public class Values extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
areEqual(Object value,
Boolean expected)
Returns if the value is equal to the
Boolean in parameter. |
static boolean |
areEqual(Object value,
byte[] expected)
Returns if the value is equal to the array of
byte in parameter. |
static boolean |
areEqual(Object value,
DateTimeValue expected)
Returns if the value is equal to the
DateTimeValue in parameter. |
static boolean |
areEqual(Object value,
DateValue expected)
Returns if the value is equal to the
DateValue in parameter. |
static boolean |
areEqual(Object value,
Number expected)
Returns if the value is equal to the
Number in parameter. |
static boolean |
areEqual(Object value,
Object expected)
Returns if the value is equal to another value in parameter.
|
static boolean |
areEqual(Object value,
String expected)
Returns if the value is equal to the
String in parameter. |
static boolean |
areEqual(Object value,
TimeValue expected)
Returns if the value is equal to the
TimeValue in parameter. |
static int |
compare(Object value,
Number expected)
Returns the result of the comparison between the value and the
Number in parameter. |
static Object |
getRepresentationFromValueInFrontOfExpected(Object value,
Object expected)
Returns a representation of the value (this representation is used for error message).
|
static Object[] |
getRepresentationsFromValuesInFrontOfExpected(Object[] values,
Object[] expected)
Returns a representation of the values (this representation is used for error message).
|
public static boolean areEqual(Object value, Object expected)
value
- The value.expected
- The other value to compare.true
if the value is equal to the value in parameter, false
otherwise.public static boolean areEqual(Object value, Boolean expected)
Boolean
in parameter.value
- The value.expected
- The Boolean
to compare.true
if the value is equal to the Boolean
parameter, false
otherwise.public static boolean areEqual(Object value, Number expected)
Number
in parameter.value
- The value.expected
- The Number
to compare.true
if the value is equal to the Number
parameter, false
otherwise.public static boolean areEqual(Object value, byte[] expected)
byte
in parameter.value
- The value.expected
- The array of byte
to compare.true
if the value is equal to the array of byte
parameter, false
otherwise.public static boolean areEqual(Object value, String expected)
String
in parameter.value
- The value.expected
- The String
to compare.true
if the value is equal to the String
parameter, false
otherwise.NullPointerException
- if expected
is null
.AssertJDBException
- If value
is a Number
and it is not possible to compare to
expected
.public static boolean areEqual(Object value, DateValue expected)
DateValue
in parameter.public static boolean areEqual(Object value, TimeValue expected)
TimeValue
in parameter.public static boolean areEqual(Object value, DateTimeValue expected)
DateTimeValue
in parameter.value
- The value.expected
- The DateTimeValue
to compare.true
if the value is equal to the DateTimeValue
parameter, false
otherwise.public static int compare(Object value, Number expected)
Number
in parameter.value
- The value.expected
- The Number
to compare.0
if the value is equal to the Number
parameter, -1
if value is less than the
Number
parameter and 1
if value is greater than the Number
parameter.public static Object[] getRepresentationsFromValuesInFrontOfExpected(Object[] values, Object[] expected)
values
- Values in the database.expected
- Expected values for comparison.AssertJDBException
- If the length of the two arrays are different.public static Object getRepresentationFromValueInFrontOfExpected(Object value, Object expected)
value
- Value in the database.expected
- Expected value for comparison.Copyright © 2015 AssertJ. All Rights Reserved.