Class AssertionsOnColumnType

java.lang.Object
org.assertj.db.api.assertions.impl.AssertionsOnColumnType

public class AssertionsOnColumnType extends Object
Implements the assertion methods on the type of a column.

The different type of values are enumerated in ValueType.

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

    Modifier and Type
    Method
    Description
    static <A extends AbstractAssert<?>>
    A
    isBoolean(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
    Verifies that the type of the values of the column is boolean.
    static <A extends AbstractAssert<?>>
    A
    isBytes(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
    Verifies that the type of the values of the column is array of bytes.
    static <A extends AbstractAssert<?>>
    A
    isDate(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
    Verifies that the type of the values of the column is date.
    static <A extends AbstractAssert<?>>
    A
    isDateTime(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
    Verifies that the type of the values of the column is date/time.
    static <A extends AbstractAssert<?>>
    A
    isNumber(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
    Verifies that the type of the values of the column is number.
    static <A extends AbstractAssert<?>>
    A
    isOfAnyTypeIn(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, ValueType... expected)
    Verifies that the type of the column is equal to one of the types in parameters.
    static <A extends AbstractAssert<?>>
    A
    isOfType(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, ValueType expected, boolean lenient)
    /** Verifies that the type of the values of the column is equal to the type in parameter.
    static <A extends AbstractAssert<?>>
    A
    isText(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
    Verifies that the type of the values of the column is text.
    static <A extends AbstractAssert<?>>
    A
    isTime(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
    Verifies that the type of the values of the column is time.
    static <A extends AbstractAssert<?>>
    A
    isUUID(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
    Verifies that the type of the values of the column is UUID.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isOfType

      public static <A extends AbstractAssert<?>> A isOfType(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, ValueType expected, boolean lenient)
      /** Verifies that the type of the values of the column is equal to the type in parameter.
      Type Parameters:
      A - The type of the assertion which call this method.
      Parameters:
      assertion - The assertion which call this method.
      info - Writable information about an assertion.
      valuesList - The list of values.
      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.
    • isOfAnyTypeIn

      public static <A extends AbstractAssert<?>> A isOfAnyTypeIn(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, ValueType... expected)
      Verifies that the type of the column is equal to one of the types in parameters.
      Type Parameters:
      A - The type of the assertion which call this method.
      Parameters:
      assertion - The assertion which call this method.
      info - Writable information about an assertion.
      valuesList - The list of values.
      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.
    • isNumber

      public static <A extends AbstractAssert<?>> A isNumber(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
      Verifies that the type of the values of the column is number.
      Type Parameters:
      A - The type of the assertion which call this method.
      Parameters:
      assertion - The assertion which call this method.
      info - Writable information about an assertion.
      valuesList - The list of values.
      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.
    • isBoolean

      public static <A extends AbstractAssert<?>> A isBoolean(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
      Verifies that the type of the values of the column is boolean.
      Type Parameters:
      A - The type of the assertion which call this method.
      Parameters:
      assertion - The assertion which call this method.
      info - Writable information about an assertion.
      valuesList - The list of values.
      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.
    • isDate

      public static <A extends AbstractAssert<?>> A isDate(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
      Verifies that the type of the values of the column is date.
      Type Parameters:
      A - The type of the assertion which call this method.
      Parameters:
      assertion - The assertion which call this method.
      info - Writable information about an assertion.
      valuesList - The list of values.
      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.
    • isTime

      public static <A extends AbstractAssert<?>> A isTime(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
      Verifies that the type of the values of the column is time.
      Type Parameters:
      A - The type of the assertion which call this method.
      Parameters:
      assertion - The assertion which call this method.
      info - Writable information about an assertion.
      valuesList - The list of values.
      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.
    • isDateTime

      public static <A extends AbstractAssert<?>> A isDateTime(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
      Verifies that the type of the values of the column is date/time.
      Type Parameters:
      A - The type of the assertion which call this method.
      Parameters:
      assertion - The assertion which call this method.
      info - Writable information about an assertion.
      valuesList - The list of values.
      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.
    • isBytes

      public static <A extends AbstractAssert<?>> A isBytes(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
      Verifies that the type of the values of the column is array of bytes.
      Type Parameters:
      A - The type of the assertion which call this method.
      Parameters:
      assertion - The assertion which call this method.
      info - Writable information about an assertion.
      valuesList - The list of values.
      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.
    • isText

      public static <A extends AbstractAssert<?>> A isText(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
      Verifies that the type of the values of the column is text.
      Type Parameters:
      A - The type of the assertion which call this method.
      Parameters:
      assertion - The assertion which call this method.
      info - Writable information about an assertion.
      valuesList - The list of values.
      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.
    • isUUID

      public static <A extends AbstractAssert<?>> A isUUID(A assertion, org.assertj.core.api.WritableAssertionInfo info, List<Value> valuesList, boolean lenient)
      Verifies that the type of the values of the column is UUID.
      Type Parameters:
      A - The type of the assertion which call this method.
      Parameters:
      assertion - The assertion which call this method.
      info - Writable information about an assertion.
      valuesList - The list of values.
      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