Interface ToColumn<C extends ColumnElement>
- Type Parameters:
C- The class of a assertion on a column (an sub-class ofColumnElement).
- All Superinterfaces:
Navigation
- All Known Subinterfaces:
OriginWithColumnsAndRows<C,,R> OriginWithColumnsAndRowsFromChange<CHS,,CH, C, R> OriginWithValuesFromColumn<CHS,,CH, C, R, V> OriginWithValuesFromRow<CHS,CH, C, R, V>
- All Known Implementing Classes:
AbstractAssertWithOriginWithColumnsAndRows,AbstractAssertWithOriginWithColumnsAndRowsFromChange,AbstractAssertWithValues,AbstractColumnAssert,AbstractColumnOutputter,AbstractColumnValueAssert,AbstractColumnValueOutputter,AbstractDbAssert,AbstractDbOutputter,AbstractOutputterWithOriginWithColumnsAndRows,AbstractOutputterWithOriginWithColumnsAndRowsFromChange,AbstractOutputterWithValues,AbstractRowAssert,AbstractRowOutputter,AbstractRowValueAssert,AbstractRowValueOutputter,AbstractSubAssert,AbstractSubOutputter,AbstractValueAssert,AbstractValueOutputter,ChangeAssert,ChangeColumnAssert,ChangeColumnOutputter,ChangeColumnValueAssert,ChangeColumnValueOutputter,ChangeOutputter,ChangeRowAssert,ChangeRowOutputter,ChangeRowValueAssert,ChangeRowValueOutputter,RequestAssert,RequestColumnAssert,RequestColumnOutputter,RequestColumnValueAssert,RequestColumnValueOutputter,RequestOutputter,RequestRowAssert,RequestRowOutputter,RequestRowValueAssert,RequestRowValueOutputter,TableAssert,TableColumnAssert,TableColumnOutputter,TableColumnValueAssert,TableColumnValueOutputter,TableOutputter,TableRowAssert,TableRowOutputter,TableRowValueAssert,TableRowValueOutputter
Column.
The different methods return an assertion on one column ColumnElement.
These methods exists when navigating (at the beginning assertThat()) from changes, from a Table or from a Request.
As shown in the diagram below, if navigating from table or request, it is possible to call the method to navigate to a ColumnElement from :
- a table (
TableAssert) - a request (
RequestAssert) - a column (
AbstractColumnAssert) - a value of a column (
AbstractColumnValueAssert) - a row (
AbstractRowAssert) - a value of a row (
AbstractRowValueAssert)
If navigating from table or request, it is important to keep in mind that the methods are executed from the point of view of the last instance with assertion methods on a table (TableAssert) or on a request (RequestAssert).
So all the lines of code below are equivalent : they point on the column at index 1 (as usual, the list start at index 0).
assertThat(table_or_request).column(1)......; // Point directly on the column at index 1
assertThat(table_or_request).column().returnToColumn().column()......; // Use the returnToColumn() method to return to origin
// to return on the table or request and access to the next/second column of the list
assertThat(table_or_request).column().column()......; // Same as precedent but returnToColumn() is implicit
assertThat(table_or_request).column().column(1)......; // The method with the index can be call too
assertThat(table_or_request).column(2).column(0).column(1)......; // Idem
assertThat(table_or_request).column().value().column()......;
assertThat(table_or_request).column().value().column(1)......;
// Equivalent to the precedent but with the use of the methods to return to origin
assertThat(table_or_request).column().value().returnToColumn().returnToChange().column(1)......;
As shown in the diagram below, if navigating from changes, it is possible to call the method to navigate to a ColumnElement from :
- a change (
ChangeAssert) - a column of a change (
ChangeColumnAssert) - a value of a column of a change (
ChangeColumnValueAssert) - a row of a change (
ChangeRowAssert) - a value of a row of a change (
ChangeRowValueAssert)
If navigating from changes, it is important to keep in mind that the methods are executed from the point of view of the last instance with assertion methods on a change (ChangeAssert).
So all the lines of code below are equivalent : they point on the column at index 1 (as usual, the list start at index 0).
assertThat(changes).change().column(1)......; // Point directly on the column at index 1
// Use the returnToChange() method to return on the change and access to the next/second column of the list
assertThat(changes).change().column().returnToChange().column()......;
assertThat(changes).change().column().column()......; // Same as precedent but returnToChange() is implicit
assertThat(changes).change().column().column(1)......; // The method with the index can be call too
assertThat(changes).change().column(2).column(0).column(1)......; // Idem
assertThat(changes).change().column().value().column()......;
assertThat(changes).change().column().value().column(1)......;
// Equivalent to the precedent but with the use of the methods to return to origin
assertThat(changes).change().column().value().returnToColumn().returnToChange().column(1)......;
- Author:
- Régis Pouiller
-
Method Details
-
column
C column()- Returns:
- An object to make assertions on the next
Column. - Throws:
AssertJDBException- If there are no moreColumnin the list ofColumns.- See Also:
-
column
Returns assertion methods on theColumnat theindexin parameter.- Parameters:
index- The index corresponding to theColumn.- Returns:
- An object to make assertions on the
Column. - Throws:
AssertJDBException- If theindexis out of the bounds.- See Also:
-
column
Returns assertion methods on theColumncorresponding to the column name in parameter.- Parameters:
columnName- The column name.- Returns:
- An object to make assertions on the
Column. - Throws:
NullPointerException- If the column name in parameter isnull.AssertJDBException- If there is noColumnwith this name.- See Also:
-