Class AssertionFailedErrorBuilder.PrefixedValues
- java.lang.Object
-
- com.github.robtimus.junit.support.AssertionFailedErrorBuilder.PrefixedValues
-
- Enclosing class:
- AssertionFailedErrorBuilder
public static final class AssertionFailedErrorBuilder.PrefixedValues extends Object
An object that can set the possible expected value or actual value of an assertion with a prefix.- Author:
- Rob Spoor
- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AssertionFailedErrorBuilder
actual(Object actual)
Sets the actual value of the assertion.AssertionFailedErrorBuilder
actualValues(Object... actual)
Sets the multiple actual values of the assertion.AssertionFailedErrorBuilder
actualValues(Collection<?> actual)
Sets the multiple actual values of the assertion.AssertionFailedErrorBuilder
expected(Object expected)
Sets the expected value of the assertion.AssertionFailedErrorBuilder
expectedOneOf(Object... expected)
Sets the possible expected values of the assertion.AssertionFailedErrorBuilder
expectedOneOf(Collection<?> expected)
Sets the possible expected values of the assertion.
-
-
-
Method Detail
-
expected
public AssertionFailedErrorBuilder expected(Object expected)
Sets the expected value of the assertion.- Parameters:
expected
- The expected value.- Returns:
- The
AssertionFailedErrorBuilder
that returned this object.
-
expectedOneOf
public AssertionFailedErrorBuilder expectedOneOf(Object... expected)
Sets the possible expected values of the assertion.Note that the
expected value
of the assertion will be a list containing the expected values.- Parameters:
expected
- The expected values.- Returns:
- The
AssertionFailedErrorBuilder
that returned this object.
-
expectedOneOf
public AssertionFailedErrorBuilder expectedOneOf(Collection<?> expected)
Sets the possible expected values of the assertion.Note that the
expected value
of the assertion will be a list containing the expected values.- Parameters:
expected
- The expected values.- Returns:
- The
AssertionFailedErrorBuilder
that returned this object. - Throws:
NullPointerException
- If the given collection isnull
.
-
actual
public AssertionFailedErrorBuilder actual(Object actual)
Sets the actual value of the assertion.- Parameters:
actual
- The actual value.- Returns:
- The
AssertionFailedErrorBuilder
that returned this object.
-
actualValues
public AssertionFailedErrorBuilder actualValues(Object... actual)
Sets the multiple actual values of the assertion.Note that the
actual value
of the assertion will be a list containing the actual values.- Parameters:
actual
- The actual values.- Returns:
- The
AssertionFailedErrorBuilder
that returned this object.
-
actualValues
public AssertionFailedErrorBuilder actualValues(Collection<?> actual)
Sets the multiple actual values of the assertion.Note that the
actual value
of the assertion will be a list containing the actual values.- Parameters:
actual
- The actual values.- Returns:
- The
AssertionFailedErrorBuilder
that returned this object. - Throws:
NullPointerException
- If the given collection isnull
.
-
-