Interface AssertOnValueType<T extends AssertOnValueType<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:
AbstractAssertWithValues, AbstractColumnValueAssert, AbstractRowValueAssert, AbstractValueAssert, ChangeColumnValueAssert, ChangeRowValueAssert, RequestColumnValueAssert, RequestRowValueAssert, TableColumnValueAssert, TableRowValueAssert

public interface AssertOnValueType<T extends AssertOnValueType<T>>
Defines the assertion methods on the type of a value.

The different type of values are enumerated in ValueType.

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

    Modifier and Type
    Method
    Description
    Verifies that the value is a boolean.
    Verifies that the value is a array of bytes.
    Verifies that the value is a date.
    Verifies that the value is a date/time.
    Verifies that the value is a number.
    isOfAnyTypeIn(ValueType... expected)
    Verifies that the type of the value is equal to one of the types in parameters.
    isOfType(ValueType expected)
    Verifies that the type of the value is equal to the type in parameter.
    Verifies that the value is a text.
    Verifies that the value is a time.
    Verifies that the value is an UUID.
  • Method Details

    • isOfType

      T isOfType(ValueType expected)
      Verifies that the type of the value is equal to the type in parameter.

      Example where the assertion verifies that the value in the Column called "title" of the second Row of the Table is of type TEXT :

       
       assertThat(table).row(1).value("title").isOfType(ValueType.TEXT);
       
       

      Example where the assertion verifies that the value in the Column called "title" of the Row at end point of the first Change is of type TEXT :

       
       assertThat(changes).change().rowAtEndPoint().value("title").isOfType(ValueType.TEXT);
       
       
      Parameters:
      expected - The expected type to compare to.
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the value is different to the type in parameter.
      See Also:
    • isOfAnyTypeIn

      T isOfAnyTypeIn(ValueType... expected)
      Verifies that the type of the value is equal to one of the types in parameters.

      Example where the assertion verifies that the value in the Column called "title" of the second Row of the Table is of type TEXT or of type NUMBER :

       
       assertThat(table).row(1).value("title").isOfType(ValueType.TEXT, ValueType.NUMBER);
       
       

      Example where the assertion verifies that the value in the Column called "title" of the Row at end point of the first Change is of type TEXT or of type NUMBER :

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

      T isNumber()
      Verifies that the value is a number.

      Example where the assertion verifies that the value in the Column called "year" of the first Row of the Table is a number :

       
       assertThat(table).row().value("year").isNumber();
       
       

      Example where the assertion verifies that the value in the first Column of the Row at end point of the first Change is a number :

       
       assertThat(changes).change().rowAtEndPoint().value().isNumber();
       
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.NUMBER);
       
       
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the value is not number.
      See Also:
    • isBoolean

      T isBoolean()
      Verifies that the value is a boolean.

      Example where the assertion verifies that the value in the first Column of the first Row of the Table is a boolean :

       
       assertThat(table).row().value().isBoolean();
       
       

      Example where the assertion verifies that the value in the first Column of the Row at end point of the first Change is a boolean :

       
       assertThat(changes).change().rowAtEndPoint().value().isBoolean();
       
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.BOOLEAN);
       
       
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the value is not boolean.
      See Also:
    • isDate

      T isDate()
      Verifies that the value is a date.

      Example where the assertion verifies that the value in the Column called "birth" of the first Row of the Table is a date :

       
       assertThat(table).row().value("birth").isDate();
       
       

      Example where the assertion verifies that the value in the first Column of the Row at end point of the first Change is a date :

       
       assertThat(changes).change().rowAtEndPoint().value().isDate();
       
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.DATE);
       
       
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the value is not date.
      See Also:
    • isTime

      T isTime()
      Verifies that the value is a time.

      Example where the assertion verifies that the value in the first Column of the first Row of the Table is a time :

       
       assertThat(table).row().value().isTime();
       
       

      Example where the assertion verifies that the value in the first Column of the Row at end point of the first Change is a time :

       
       assertThat(changes).change().rowAtEndPoint().value().isTime();
       
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.TIME);
       
       
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the value is not time.
      See Also:
    • isDateTime

      T isDateTime()
      Verifies that the value is a date/time.

      Example where the assertion verifies that the value in the first Column of the first Row of the Table is a date/time :

       
       assertThat(table).row().value().isDateTime();
       
       

      Example where the assertion verifies that the value in the first Column of the Row at end point of the first Change is a date/time :

       
       assertThat(changes).change().rowAtEndPoint().value().isDateTime();
       
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.DATE_TIME);
       
       
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the value is not date/time.
      See Also:
    • isBytes

      T isBytes()
      Verifies that the value is a array of bytes.

      Example where the assertion verifies that the value in the first Column of the first Row of the Table is a array of bytes :

       
       assertThat(table).row().value().isBytes();
       
       

      Example where the assertion verifies that the value in the first Column of the Row at end point of the first Change is a array of bytes :

       
       assertThat(changes).change().rowAtEndPoint().value().isBytes();
       
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.BYTES);
       
       
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the value is not array of bytes.
      See Also:
    • isText

      T isText()
      Verifies that the value is a text.

      Example where the assertion verifies that the value in the Column called "title" of the first Row of the Table is a text :

       
       assertThat(table).row().value("title").isText();
       
       

      Example where the assertion verifies that the value in the first Column of the Row at end point of the first Change is a text :

       
       assertThat(changes).change().rowAtEndPoint().value().isText();
       
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.TEXT);
       
       
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the value is not text.
      See Also:
    • isUUID

      T isUUID()
      Verifies that the value is an UUID.

      Example where the assertion verifies that the value in the Column called id of the first Row of the Table is an UUID :

       
       assertThat(table).row().value("id").isUUID();
       
       

      Example where the assertion verifies that the value in the first Column of the Row at end point of the first Change is an UUID :

       
       assertThat(changes).change().rowAtEndPoint().value().isUUID();
       
       

      This assertion method is equivalent to :

       
       xxxxx.isOfType(ValueType.UUID);
       
       
      Returns:
      this assertion object.
      Throws:
      AssertionError - If the type of the value is not UUID.
      Since:
      1.1.0
      See Also: