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

public interface AssertOnColumnType<T extends AssertOnColumnType<T>>
Defines the assertion methods on the type of a column.

The different type of values are enumerated in ValueType.

Author:
Régis Pouiller, Otoniel Isidoro
  • Method Summary

    Modifier and Type
    Method
    Description
    isBoolean(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.
    isOfType(ValueType expected, boolean lenient)
    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

      T isOfType(ValueType expected, boolean lenient)
      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 Column called "title" of the Table is of type TEXT :

      
       assertThat(table).column("title").isOfType(ValueType.TEXT, false);
       

      Example where the assertion verifies that all the values in the Column called "title" of the Table is of type TEXT or not identified (for example null) :

      
       assertThat(table).column("title").isOfType(ValueType.TEXT, true);
       
      Parameters:
      expected - The expected type to compare to.
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the column is different to the type in parameter.
      See Also:
    • isOfAnyTypeIn

      T isOfAnyTypeIn(ValueType... expected)
      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 Column called "title" of the Table is of type TEXT or of type NUMBER :

      
       assertThat(table).column("title").isOfAnyTypeIn(ValueType.TEXT, ValueType.NUMBER);
       
      Parameters:
      expected - The expected types to compare to.
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the column is different to all the types in parameters.
      See Also:
    • isNumber

      T isNumber(boolean lenient)
      Verifies that the type of the values of the column is number.

      Example where the assertion verifies that all the values in the Column called "year" of the Table is a number :

      
       assertThat(table).column("year").isNumber(true);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.NUMBER, lenient);
       
       
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the column is not number.
      See Also:
    • isBoolean

      T isBoolean(boolean lenient)
      Verifies that the type of the values of the column is boolean.

      Example where the assertion verifies that all the values in the first Column of the Table is a boolean :

      
       assertThat(table).column().isBoolean(false);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.BOOLEAN, lenient);
       
       
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the column is not boolean.
      See Also:
    • isDate

      T isDate(boolean lenient)
      Verifies that the type of the values of the column is date.

      Example where the assertion verifies that all the values in the Column called "birth" of the Table is a date :

      
       assertThat(table).column("birth").isDate(false);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.DATE, lenient);
       
       
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the column is not date.
      See Also:
    • isTime

      T isTime(boolean lenient)
      Verifies that the type of the values of the column is time.

      Example where the assertion verifies that all the values in the first Column of the Table is a time :

      
       assertThat(table).column().isTime(false);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.TIME, lenient);
       
       
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the column is not time.
      See Also:
    • isDateTime

      T isDateTime(boolean lenient)
      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 Column of the Table is a date/time :

      
       assertThat(table).column().isDateTime(false);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.DATE_TIME, lenient);
       
       
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the column is not date/time.
      See Also:
    • isBytes

      T isBytes(boolean lenient)
      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 Column of the Table is a array of bytes :

      
       assertThat(table).column().isBytes(false);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.BYTES, lenient);
       
       
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the column is not array of bytes.
      See Also:
    • isText

      T isText(boolean lenient)
      Verifies that the type of the values of the column is text.

      Example where the assertion verifies that all the values in the Column called "title" of the Table is a text :

      
       assertThat(table).column("title").isText(false);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.TEXT, lenient);
       
       
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the column is not text.
      See Also:
    • isUUID

      T isUUID(boolean lenient)
      Verifies that the type of the values of the column is UUID.

      Example where the assertion verifies that all the values in the Column called "id" of the Table is UUID :

      
       assertThat(table).column("id").isUUID(false);
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.UUID, lenient);
       
       
      Parameters:
      lenient - true if the test is lenient : if the type of a value is not identified (for example when the value is null), it consider that it is ok.
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the column is not UUID.
      Since:
      1.1.0
      See Also: