Package org.assertj.db.util
Class Values
java.lang.Object
org.assertj.db.util.Values
Utility methods related to values.
- Author:
- Régis Pouiller, Otoniel Isidoro
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns if the value is close to theNumberin parameter with the tolerance in parameter.static booleanareClose(Value value, DateTimeValue expected, DateTimeValue tolerance) Returns if the value is close to theDateTimeValuein parameter with the tolerance in parameter.static booleanareClose(Value value, DateTimeValue expected, DateValue tolerance) Returns if the value is close to theDateTimeValuein parameter with the tolerance in parameter.static booleanareClose(Value value, DateTimeValue expected, TimeValue tolerance) Returns if the value is close to theDateTimeValuein parameter with the tolerance in parameter.static booleanareClose(Value value, DateValue expected, DateTimeValue tolerance) Returns if the value is close to theDateValuein parameter with the tolerance in parameter.static booleanReturns if the value is close to theDateValuein parameter with the tolerance in parameter.static booleanReturns if the value is close to theDateValuein parameter with the tolerance in parameter.static booleanReturns if the value is close to theTimeValuein parameter with the tolerance in parameter.static booleanReturns if theUUIDvalue is equal to theStringin parameter.static booleanReturns if the value is equal to the array ofbytein parameter.static booleanReturns if the value is equal to theBooleanin parameter.static booleanReturns if the value is equal to theStringin parameter.static booleanReturns if the value is equal to theNumberin parameter.static booleanReturns if the value is equal to another value in parameter.static booleanReturns if the value is equal to theStringin parameter.static booleanReturns if the value is equal to theUUIDin parameter.static booleanareEqual(Value value, DateTimeValue expected) Returns if the value is equal to theDateTimeValuein parameter.static booleanReturns if the value is equal to theDateValuein parameter.static booleanReturns if the value is equal to theTimeValuein parameter.static intReturns the result of the comparison between the value and theNumberin parameter.static ObjectgetRepresentationFromValueInFrontOfClass(Value value, Class<?> clazz) Returns a representation of the value (this representation is used for error message).static ObjectgetRepresentationFromValueInFrontOfExpected(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).
-
Method Details
-
areEqual
Returns if the value is equal to another value in parameter.- Parameters:
value- The value.expected- The other value to compare.- Returns:
trueif the value is equal to the value in parameter,falseotherwise.
-
areEqual
Returns if the value is equal to theBooleanin parameter.- Parameters:
value- The value.expected- TheBooleanto compare.- Returns:
trueif the value is equal to theBooleanparameter,falseotherwise.
-
areEqual
Returns if the value is equal to theNumberin parameter.- Parameters:
value- The value.expected- TheNumberto compare.- Returns:
trueif the value is equal to theNumberparameter,falseotherwise.
-
areEqual
Returns if the value is equal to the array ofbytein parameter.- Parameters:
value- The value.expected- The array ofbyteto compare.- Returns:
trueif the value is equal to the array ofbyteparameter,falseotherwise.
-
areEqual
Returns if the value is equal to theStringin parameter.- Parameters:
value- The value.expected- TheStringto compare.- Returns:
trueif the value is equal to theStringparameter,falseotherwise.- Throws:
NullPointerException- ifexpectedisnull.AssertJDBException- Ifvalueis aNumberand it is not possible to compare toexpected.
-
areEqual
Returns if the value is equal to theStringin parameter.- Parameters:
value- The value.expected- TheCharacterto compare.- Returns:
trueif the value is equal to theCharacterparameter,falseotherwise.- Throws:
NullPointerException- ifexpectedisnull.- Since:
- 1.2.0
-
areEqual
Returns if the value is equal to theUUIDin parameter.- Parameters:
value- The value.expected- TheUUIDto compare.- Returns:
trueif the value is equal to theUUIDparameter,falseotherwise.- Since:
- 1.1.0
-
areEqual
Returns if theUUIDvalue is equal to theStringin parameter.- Parameters:
value- TheUUIDvalue.expected- TheStringto compare.- Returns:
trueif theUUIDvalue is equal to theStringparameter,falseotherwise.- Throws:
AssertJDBException- If it is not possible to compareUUIDtoexpected.- Since:
- 1.1.0
-
areEqual
Returns if the value is equal to theDateValuein parameter. -
areEqual
Returns if the value is equal to theTimeValuein parameter. -
areEqual
Returns if the value is equal to theDateTimeValuein parameter.- Parameters:
value- The value.expected- TheDateTimeValueto compare.- Returns:
trueif the value is equal to theDateTimeValueparameter,falseotherwise.
-
compare
Returns the result of the comparison between the value and theNumberin parameter.- Parameters:
value- The value.expected- TheNumberto compare.- Returns:
0if the value is equal to theNumberparameter,-1if value is less than theNumberparameter and1if value is greater than theNumberparameter.
-
getRepresentationsFromValuesInFrontOfExpected
public static Object[] getRepresentationsFromValuesInFrontOfExpected(Value[] values, Object[] expected) Returns a representation of the values (this representation is used for error message).- Parameters:
values- Values in the database.expected- Expected values for comparison.- Returns:
- A representation of the values.
- Throws:
AssertJDBException- If the length of the two arrays are different.
-
getRepresentationFromValueInFrontOfExpected
Returns a representation of the value (this representation is used for error message).- Parameters:
value- Value in the database.expected- Expected value for comparison.- Returns:
- A representation of the value.
-
getRepresentationFromValueInFrontOfClass
Returns a representation of the value (this representation is used for error message).- Parameters:
value- Value in the database.clazz- Class for comparison.- Returns:
- A representation of the value.
-
areClose
Returns if the value is close to theNumberin parameter with the tolerance in parameter.- Parameters:
value- The value.expected- TheNumberto compare.tolerance- The tolerance of the closeness.- Returns:
trueif the value is close to theNumberparameter,falseotherwise.
-
areClose
Returns if the value is close to theDateValuein parameter with the tolerance in parameter.- Parameters:
value- The value.expected- TheDateValueto compare.tolerance- The tolerance of the closeness.- Returns:
trueif the value is close to theDateValueparameter,falseotherwise.
-
areClose
Returns if the value is close to theDateValuein parameter with the tolerance in parameter.- Parameters:
value- The value.expected- TheDateValueto compare.tolerance- The tolerance of the closeness.- Returns:
trueif the value is close to theDateValueparameter,falseotherwise.
-
areClose
Returns if the value is close to theDateValuein parameter with the tolerance in parameter.- Parameters:
value- The value.expected- TheDateValueto compare.tolerance- The tolerance of the closeness.- Returns:
trueif the value is close to theDateValueparameter,falseotherwise.
-
areClose
Returns if the value is close to theTimeValuein parameter with the tolerance in parameter.- Parameters:
value- The value.expected- TheTimeValueto compare.tolerance- The tolerance of the closeness.- Returns:
trueif the value is close to theTimeValueparameter,falseotherwise.
-
areClose
Returns if the value is close to theDateTimeValuein parameter with the tolerance in parameter.- Parameters:
value- The value.expected- TheDateTimeValueto compare.tolerance- The tolerance of the closeness.- Returns:
trueif the value is close to theDateTimeValueparameter,falseotherwise.
-
areClose
Returns if the value is close to theDateTimeValuein parameter with the tolerance in parameter.- Parameters:
value- The value.expected- TheDateTimeValueto compare.tolerance- The tolerance of the closeness.- Returns:
trueif the value is close to theDateTimeValueparameter,falseotherwise.
-
areClose
Returns if the value is close to theDateTimeValuein parameter with the tolerance in parameter.- Parameters:
value- The value.expected- TheDateTimeValueto compare.tolerance- The tolerance of the closeness.- Returns:
trueif the value is close to theDateTimeValueparameter,falseotherwise.
-