T
- The "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation"
for more details.public interface AssertOnValueType<T extends AssertOnValueType<T>>
The different type of values are enumerated in ValueType
.
Modifier and Type | Method and Description |
---|---|
T |
isBoolean()
Verifies that the value is a boolean.
|
T |
isBytes()
Verifies that the value is a array of bytes.
|
T |
isDate()
Verifies that the value is a date.
|
T |
isDateTime()
Verifies that the value is a date/time.
|
T |
isNumber()
Verifies that the value is a number.
|
T |
isOfAnyOfTypes(ValueType... expected)
Verifies that the type of the value is equal to one of the types in parameters.
|
T |
isOfType(ValueType expected)
Verifies that the type of the value is equal to the type in parameter.
|
T |
isText()
Verifies that the value is a text.
|
T |
isTime()
Verifies that the value is a time.
|
T isOfType(ValueType expected)
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);
expected
- The expected type to compare to.this
assertion object.AssertionError
- If the type of the value is different to the type in parameter.AbstractValueAssert.isOfType(org.assertj.db.type.ValueType)
,
AbstractAssertWithValues.isOfType(org.assertj.db.type.ValueType)
T isOfAnyOfTypes(ValueType... expected)
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);
expected
- The expected types to compare to.this
assertion object.AssertionError
- If the type of the value is different to all the types in parameters.AbstractValueAssert.isOfAnyOfTypes(org.assertj.db.type.ValueType...)
,
AbstractAssertWithValues.isOfAnyOfTypes(org.assertj.db.type.ValueType...)
T isNumber()
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);
this
assertion object.AssertionError
- If the type of the value is not number.ValueType.NUMBER
,
AbstractValueAssert.isNumber()
,
AbstractAssertWithValues.isNumber()
T isBoolean()
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);
this
assertion object.AssertionError
- If the type of the value is not boolean.ValueType.BOOLEAN
,
AbstractValueAssert.isBoolean()
,
AbstractAssertWithValues.isBoolean()
T isDate()
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);
this
assertion object.AssertionError
- If the type of the value is not date.ValueType.DATE
,
AbstractValueAssert.isDate()
,
AbstractAssertWithValues.isDate()
T isTime()
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);
this
assertion object.AssertionError
- If the type of the value is not time.ValueType.TIME
,
AbstractValueAssert.isTime()
,
AbstractAssertWithValues.isTime()
T isDateTime()
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);
this
assertion object.AssertionError
- If the type of the value is not date/time.ValueType.DATE_TIME
,
AbstractValueAssert.isDateTime()
,
AbstractAssertWithValues.isDateTime()
T isBytes()
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);
this
assertion object.AssertionError
- If the type of the value is not array of bytes.ValueType.BYTES
,
AbstractValueAssert.isBytes()
,
AbstractAssertWithValues.isBytes()
T isText()
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);
this
assertion object.AssertionError
- If the type of the value is not text.ValueType.TEXT
,
AbstractValueAssert.isText()
,
AbstractAssertWithValues.isText()
Copyright © 2015 AssertJ. All Rights Reserved.