public class Values extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
areClose(Value value,
DateTimeValue expected,
DateTimeValue tolerance)
Returns if the value is close to the
DateTimeValue in parameter with the tolerance in parameter. |
static boolean |
areClose(Value value,
DateTimeValue expected,
DateValue tolerance)
Returns if the value is close to the
DateTimeValue in parameter with the tolerance in parameter. |
static boolean |
areClose(Value value,
DateTimeValue expected,
TimeValue tolerance)
Returns if the value is close to the
DateTimeValue in parameter with the tolerance in parameter. |
static boolean |
areClose(Value value,
DateValue expected,
DateTimeValue tolerance)
Returns if the value is close to the
DateValue in parameter with the tolerance in parameter. |
static boolean |
areClose(Value value,
DateValue expected,
DateValue tolerance)
Returns if the value is close to the
DateValue in parameter with the tolerance in parameter. |
static boolean |
areClose(Value value,
DateValue expected,
TimeValue tolerance)
Returns if the value is close to the
DateValue in parameter with the tolerance in parameter. |
static boolean |
areClose(Value value,
Number expected,
Number tolerance)
Returns if the value is close to the
Number in parameter with the tolerance in parameter. |
static boolean |
areClose(Value value,
TimeValue expected,
TimeValue tolerance)
Returns if the value is close to the
TimeValue in parameter with the tolerance in parameter. |
static boolean |
areEqual(UUID value,
String expected)
Returns if the
UUID value is equal to the String in parameter. |
static boolean |
areEqual(Value value,
Boolean expected)
Returns if the value is equal to the
Boolean in parameter. |
static boolean |
areEqual(Value value,
byte[] expected)
Returns if the value is equal to the array of
byte in parameter. |
static boolean |
areEqual(Value value,
Character expected)
Returns if the value is equal to the
String in parameter. |
static boolean |
areEqual(Value value,
DateTimeValue expected)
Returns if the value is equal to the
DateTimeValue in parameter. |
static boolean |
areEqual(Value value,
DateValue expected)
Returns if the value is equal to the
DateValue in parameter. |
static boolean |
areEqual(Value value,
Number expected)
Returns if the value is equal to the
Number in parameter. |
static boolean |
areEqual(Value value,
Object expected)
Returns if the value is equal to another value in parameter.
|
static boolean |
areEqual(Value value,
String expected)
Returns if the value is equal to the
String in parameter. |
static boolean |
areEqual(Value value,
TimeValue expected)
Returns if the value is equal to the
TimeValue in parameter. |
static boolean |
areEqual(Value value,
UUID expected)
Returns if the value is equal to the
UUID in parameter. |
static int |
compare(Value value,
Number expected)
Returns the result of the comparison between the value and the
Number in parameter. |
static Object |
getRepresentationFromValueInFrontOfClass(Value value,
Class<?> clazz)
Returns a representation of the value (this representation is used for error message).
|
static Object |
getRepresentationFromValueInFrontOfExpected(Value value,
Object expected)
Returns a representation of the value (this representation is used for error message).
|
static Object[] |
getRepresentationsFromValuesInFrontOfExpected(Value[] values,
Object[] expected)
Returns a representation of the values (this representation is used for error message).
|
public static boolean areEqual(Value 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(Value 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(Value 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(Value 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(Value 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(Value value, Character expected)
String
in parameter.value
- The value.expected
- The Character
to compare.true
if the value is equal to the Character
parameter, false
otherwise.NullPointerException
- if expected
is null
.public static boolean areEqual(Value value, UUID expected)
UUID
in parameter.value
- The value.expected
- The UUID
to compare.true
if the value is equal to the UUID
parameter, false
otherwise.public static boolean areEqual(UUID value, String expected)
UUID
value is equal to the String
in parameter.value
- The UUID
value.expected
- The String
to compare.true
if the UUID
value is equal to the String
parameter, false
otherwise.AssertJDBException
- If it is not possible to compare UUID
to expected
.public static boolean areEqual(Value value, DateValue expected)
DateValue
in parameter.public static boolean areEqual(Value value, TimeValue expected)
TimeValue
in parameter.public static boolean areEqual(Value 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(Value 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(Value[] 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(Value value, Object expected)
value
- Value in the database.expected
- Expected value for comparison.public static Object getRepresentationFromValueInFrontOfClass(Value value, Class<?> clazz)
value
- Value in the database.clazz
- Class for comparison.public static boolean areClose(Value value, Number expected, Number tolerance)
Number
in parameter with the tolerance in parameter.value
- The value.expected
- The Number
to compare.tolerance
- The tolerance of the closeness.true
if the value is close to the Number
parameter, false
otherwise.public static boolean areClose(Value value, DateValue expected, DateValue tolerance)
DateValue
in parameter with the tolerance in parameter.value
- The value.expected
- The DateValue
to compare.tolerance
- The tolerance of the closeness.true
if the value is close to the DateValue
parameter, false
otherwise.public static boolean areClose(Value value, DateValue expected, TimeValue tolerance)
DateValue
in parameter with the tolerance in parameter.value
- The value.expected
- The DateValue
to compare.tolerance
- The tolerance of the closeness.true
if the value is close to the DateValue
parameter, false
otherwise.public static boolean areClose(Value value, DateValue expected, DateTimeValue tolerance)
DateValue
in parameter with the tolerance in parameter.value
- The value.expected
- The DateValue
to compare.tolerance
- The tolerance of the closeness.true
if the value is close to the DateValue
parameter, false
otherwise.public static boolean areClose(Value value, TimeValue expected, TimeValue tolerance)
TimeValue
in parameter with the tolerance in parameter.value
- The value.expected
- The TimeValue
to compare.tolerance
- The tolerance of the closeness.true
if the value is close to the TimeValue
parameter, false
otherwise.public static boolean areClose(Value value, DateTimeValue expected, DateValue tolerance)
DateTimeValue
in parameter with the tolerance in parameter.value
- The value.expected
- The DateTimeValue
to compare.tolerance
- The tolerance of the closeness.true
if the value is close to the DateTimeValue
parameter, false
otherwise.public static boolean areClose(Value value, DateTimeValue expected, TimeValue tolerance)
DateTimeValue
in parameter with the tolerance in parameter.value
- The value.expected
- The DateTimeValue
to compare.tolerance
- The tolerance of the closeness.true
if the value is close to the DateTimeValue
parameter, false
otherwise.public static boolean areClose(Value value, DateTimeValue expected, DateTimeValue tolerance)
DateTimeValue
in parameter with the tolerance in parameter.value
- The value.expected
- The DateTimeValue
to compare.tolerance
- The tolerance of the closeness.true
if the value is close to the DateTimeValue
parameter, false
otherwise.Copyright © 2020 AssertJ. All rights reserved.