Interface AssertOnColumnType<T extends AssertOnColumnType<T>>
- Type Parameters:
T- The "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation" for more details.
- All Known Implementing Classes:
AbstractColumnAssert,ChangeColumnAssert,RequestColumnAssert,TableColumnAssert
The different type of values are enumerated in ValueType.
- Author:
- Régis Pouiller, Otoniel Isidoro
-
Method Summary
Modifier and TypeMethodDescriptionisBoolean(boolean lenient) Verifies that the type of the values of the column is boolean.isBytes(boolean lenient) Verifies that the type of the values of the column is array of bytes.isDate(boolean lenient) Verifies that the type of the values of the column is date.isDateTime(boolean lenient) Verifies that the type of the values of the column is date/time.isNumber(boolean lenient) Verifies that the type of the values of the column is number.isOfAnyTypeIn(ValueType... expected) Verifies that the type of the column is equal to one of the types in parameters.Verifies that the type of the values of the column is equal to the type in parameter.isText(boolean lenient) Verifies that the type of the values of the column is text.isTime(boolean lenient) Verifies that the type of the values of the column is time.isUUID(boolean lenient) Verifies that the type of the values of the column is UUID.
-
Method Details
-
isOfType
Verifies that the type of the values of the column is equal to the type in parameter.Example where the assertion verifies that all the values in the
Columncalled "title" of theTableis of typeTEXT:assertThat(table).column("title").isOfType(ValueType.TEXT, false);Example where the assertion verifies that all the values in the
Columncalled "title" of theTableis of typeTEXTor not identified (for examplenull) :assertThat(table).column("title").isOfType(ValueType.TEXT, true);- Parameters:
expected- The expected type to compare to.lenient-trueif the test is lenient : if the type of a value is not identified (for example when the value isnull), it consider that it is ok.- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the column is different to the type in parameter.- See Also:
-
isOfAnyTypeIn
Verifies that the type of the column is equal to one of the types in parameters.Example where the assertion verifies that the values in the
Columncalled "title" of theTableis of typeTEXTor of typeNUMBER:assertThat(table).column("title").isOfAnyTypeIn(ValueType.TEXT, ValueType.NUMBER);- Parameters:
expected- The expected types to compare to.- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the column is different to all the types in parameters.- See Also:
-
isNumber
Verifies that the type of the values of the column is number.Example where the assertion verifies that all the values in the
Columncalled "year" of theTableis a number :assertThat(table).column("year").isNumber(true);This assertion method is equivalent to :
xxxxx.isOfType(ValueType.NUMBER, lenient);- Parameters:
lenient-trueif the test is lenient : if the type of a value is not identified (for example when the value isnull), it consider that it is ok.- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the column is not number.- See Also:
-
isBoolean
Verifies that the type of the values of the column is boolean.Example where the assertion verifies that all the values in the first
Columnof theTableis a boolean :assertThat(table).column().isBoolean(false);This assertion method is equivalent to :
xxxxx.isOfType(ValueType.BOOLEAN, lenient);- Parameters:
lenient-trueif the test is lenient : if the type of a value is not identified (for example when the value isnull), it consider that it is ok.- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the column is not boolean.- See Also:
-
isDate
Verifies that the type of the values of the column is date.Example where the assertion verifies that all the values in the
Columncalled "birth" of theTableis a date :assertThat(table).column("birth").isDate(false);This assertion method is equivalent to :
xxxxx.isOfType(ValueType.DATE, lenient);- Parameters:
lenient-trueif the test is lenient : if the type of a value is not identified (for example when the value isnull), it consider that it is ok.- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the column is not date.- See Also:
-
isTime
Verifies that the type of the values of the column is time.Example where the assertion verifies that all the values in the first
Columnof theTableis a time :assertThat(table).column().isTime(false);This assertion method is equivalent to :
xxxxx.isOfType(ValueType.TIME, lenient);- Parameters:
lenient-trueif the test is lenient : if the type of a value is not identified (for example when the value isnull), it consider that it is ok.- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the column is not time.- See Also:
-
isDateTime
Verifies that the type of the values of the column is date/time.Example where the assertion verifies that all the values in the first
Columnof theTableis a date/time :assertThat(table).column().isDateTime(false);This assertion method is equivalent to :
xxxxx.isOfType(ValueType.DATE_TIME, lenient);- Parameters:
lenient-trueif the test is lenient : if the type of a value is not identified (for example when the value isnull), it consider that it is ok.- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the column is not date/time.- See Also:
-
isBytes
Verifies that the type of the values of the column is array of bytes.Example where the assertion verifies that all the values in the first
Columnof theTableis a array of bytes :assertThat(table).column().isBytes(false);This assertion method is equivalent to :
xxxxx.isOfType(ValueType.BYTES, lenient);- Parameters:
lenient-trueif the test is lenient : if the type of a value is not identified (for example when the value isnull), it consider that it is ok.- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the column is not array of bytes.- See Also:
-
isText
Verifies that the type of the values of the column is text.Example where the assertion verifies that all the values in the
Columncalled "title" of theTableis a text :assertThat(table).column("title").isText(false);This assertion method is equivalent to :
xxxxx.isOfType(ValueType.TEXT, lenient);- Parameters:
lenient-trueif the test is lenient : if the type of a value is not identified (for example when the value isnull), it consider that it is ok.- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the column is not text.- See Also:
-
isUUID
Verifies that the type of the values of the column is UUID.Example where the assertion verifies that all the values in the
Columncalled "id" of theTableis UUID :assertThat(table).column("id").isUUID(false);This assertion method is equivalent to :
xxxxx.isOfType(ValueType.UUID, lenient);- Parameters:
lenient-trueif the test is lenient : if the type of a value is not identified (for example when the value isnull), it consider that it is ok.- Returns:
thisassertion object.- Throws:
AssertionError- If the type of the column is not UUID.- Since:
- 1.1.0
- See Also:
-