S
- the "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation"
for more details.public abstract class AbstractByteAssert<S extends AbstractByteAssert<S>> extends AbstractComparableAssert<S,Byte> implements NumberAssert<S,Byte>
Byte
s.actual, info, myself
Modifier | Constructor and Description |
---|---|
protected |
AbstractByteAssert(Byte actual,
Class<?> selfType) |
Modifier and Type | Method and Description |
---|---|
S |
isBetween(Byte start,
Byte end)
Verifies that the actual value is in [start, end] range (start included, end included).
|
S |
isEqualTo(byte expected)
Verifies that the actual value is equal to the given one.
|
S |
isGreaterThan(byte other)
Verifies that the actual value is greater than the given one.
|
S |
isGreaterThanOrEqualTo(byte other)
Verifies that the actual value is greater than or equal to the given one.
|
S |
isLessThan(byte other)
Verifies that the actual value is less than the given one.
|
S |
isLessThanOrEqualTo(byte other)
Verifies that the actual value is less than or equal to the given one.
|
S |
isNegative()
Verifies that the actual value is negative.
|
S |
isNotEqualTo(byte other)
Verifies that the actual value is not equal to the given one.
|
S |
isNotNegative()
Verifies that the actual value is non negative (positive or equal zero).
|
S |
isNotPositive()
Verifies that the actual value is non positive (negative or equal zero).
|
S |
isNotZero()
Verifies that the actual value is not equal to zero.
|
S |
isPositive()
Verifies that the actual value is positive.
|
S |
isStrictlyBetween(Byte start,
Byte end)
Verifies that the actual value is in ]start, end[ range (start excluded, end excluded).
|
S |
isZero()
Verifies that the actual value is equal to zero.
|
S |
usingComparator(Comparator<? super Byte> customComparator)
Use given custom comparator instead of relying on actual type A equals method for incoming assertion checks.
|
S |
usingDefaultComparator()
Revert to standard comparison for incoming assertion checks.
|
inBinary, inHexadecimal, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualTo
as, as, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, overridingErrorMessage
public S isEqualTo(byte expected)
expected
- the given value to compare the actual value to.this
assertion object.AssertionError
- if the actual value is null
.AssertionError
- if the actual value is not equal to the given one.public S isNotEqualTo(byte other)
other
- the given value to compare the actual value to.this
assertion object.AssertionError
- if the actual value is null
.AssertionError
- if the actual value is equal to the given one.public S isZero()
isZero
in interface NumberAssert<S extends AbstractByteAssert<S>,Byte>
public S isNotZero()
isNotZero
in interface NumberAssert<S extends AbstractByteAssert<S>,Byte>
public S isPositive()
Example:
// assertion will pass assertThat((byte) 1).isPositive(); // assertion will fail assertThat((byte) -1).isPositive();
isPositive
in interface NumberAssert<S extends AbstractByteAssert<S>,Byte>
public S isNegative()
Example:
// assertion will pass assertThat((byte) -1).isNegative(); // assertion will fail assertThat((byte) 1).isNegative();
isNegative
in interface NumberAssert<S extends AbstractByteAssert<S>,Byte>
public S isNotNegative()
Example:
// assertion will pass assertThat((byte) 1).isNotNegative(); // assertion will fail assertThat((byte) -1).isNotNegative();
isNotNegative
in interface NumberAssert<S extends AbstractByteAssert<S>,Byte>
this
assertion object.public S isNotPositive()
Example:
// assertion will pass assertThat((byte) -1).isNotPositive(); // assertion will fail assertThat((byte) 1).isNotPositive();
isNotPositive
in interface NumberAssert<S extends AbstractByteAssert<S>,Byte>
this
assertion object.public S isLessThan(byte other)
Example:
// assertion will pass assertThat((byte) 1).isLessThan(2); // assertion will fail assertThat((byte) 1).isLessThan(0); assertThat((byte) 1).isLessThan(1);
other
- the given value to compare the actual value to.this
assertion object.AssertionError
- if the actual value is null
.AssertionError
- if the actual value is equal to or greater than the given one.public S isLessThanOrEqualTo(byte other)
Example:
// assertion will pass assertThat((byte) 1).isLessThanOrEqualTo(2); assertThat((byte) 1).isLessThanOrEqualTo(1); // assertion will fail assertThat((byte) 1).isLessThanOrEqualTo(0);
other
- the given value to compare the actual value to.this
assertion object.AssertionError
- if the actual value is null
.AssertionError
- if the actual value is greater than the given one.public S isGreaterThan(byte other)
Example:
// assertion will pass assertThat((byte) 2).isGreaterThan(1); // assertion will fail assertThat((byte) 2).isGreaterThan(3); assertThat((byte) 2).isGreaterThan(2);
other
- the given value to compare the actual value to.this
assertion object.AssertionError
- if the actual value is null
.AssertionError
- if the actual value is equal to or less than the given one.public S isGreaterThanOrEqualTo(byte other)
Example:
// assertion will pass assertThat((byte) 2).isGreaterThanOrEqualTo(1); assertThat((byte) 2).isGreaterThanOrEqualTo(2); // assertion will fail assertThat((byte) 2).isGreaterThanOrEqualTo(3);
other
- the given value to compare the actual value to.this
assertion object.AssertionError
- if the actual value is null
.AssertionError
- if the actual value is less than the given one.public S isBetween(Byte start, Byte end)
Example:
// assertions will pass assertThat((byte) 1).isBetween((byte) -1, (byte) 2); assertThat((byte) 1).isBetween((byte) 1, (byte) 2); assertThat((byte) 1).isBetween((byte) 0, (byte) 1); // assertion will fail assertThat((byte) 1).isBetween((byte) 2, (byte) 3);
isBetween
in interface NumberAssert<S extends AbstractByteAssert<S>,Byte>
start
- the start value (inclusive), expected not to be null.end
- the end value (inclusive), expected not to be null.public S isStrictlyBetween(Byte start, Byte end)
Example:
// assertion will pass assertThat((byte) 1).isStrictlyBetween((byte) -1, (byte) 2); // assertions will fail assertThat((byte) 1).isStrictlyBetween((byte) 1, (byte) 2); assertThat((byte) 1).isStrictlyBetween((byte) 0, (byte) 1); assertThat((byte) 1).isStrictlyBetween((byte) 2, (byte) 3);
isStrictlyBetween
in interface NumberAssert<S extends AbstractByteAssert<S>,Byte>
start
- the start value (exclusive), expected not to be null.end
- the end value (exclusive), expected not to be null.public S usingComparator(Comparator<? super Byte> customComparator)
AbstractAssert
Custom comparator is bound to assertion instance, meaning that if a new assertion is created, it will use default comparison strategy.
Examples :
// frodo and sam are instances of Character with Hobbit race (obviously :). // raceComparator implements Comparator<Character> assertThat(frodo).usingComparator(raceComparator).isEqualTo(sam);
usingComparator
in interface Assert<S extends AbstractByteAssert<S>,Byte>
usingComparator
in class AbstractComparableAssert<S extends AbstractByteAssert<S>,Byte>
customComparator
- the comparator to use for incoming assertion checks.this
assertion object.public S usingDefaultComparator()
AbstractAssert
This method should be used to disable a custom comparison strategy set by calling Assert.usingComparator(Comparator)
.
usingDefaultComparator
in interface Assert<S extends AbstractByteAssert<S>,Byte>
usingDefaultComparator
in class AbstractComparableAssert<S extends AbstractByteAssert<S>,Byte>
this
assertion object.Copyright © 2013-2014 AssertJ. All Rights Reserved.