Top Description Inners Fields Constructors Methods
org.assertj.core.error

public Class ShouldContainOnly

extends BasicErrorMessageFactory
Class Inheritance
Static Imports
org.assertj.core.error.GroupTypeDescription.getGroupTypeDescription, .ShouldContainOnly.ErrorType.NOT_EXPECTED_ONLY, .ShouldContainOnly.ErrorType.NOT_FOUND_ONLY, org.assertj.core.util.IterableUtil.isNullOrEmpty

Creates an error message indicating that an assertion that verifies a group of elements contains only a given set of values and nothing else failed. A group of elements can be a collection, an array or a String.
Authors
Alex Ruiz, Yvonne Wang, Joel Costigliola

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Inherited from org.assertj.core.error.BasicErrorMessageFactory:
argumentsformatformatter

Constructor Summary

AccessConstructor and Description
private
ShouldContainOnly(Object actual, Object expected, Iterable<?> notFound, Iterable<?> notExpected, ComparisonStrategy comparisonStrategy, GroupTypeDescription groupTypeDescription)

private
ShouldContainOnly(Object actual, Object expected, Iterable<?> notFoundOrNotExpected, ShouldContainOnly.ErrorType errorType, ComparisonStrategy comparisonStrategy, GroupTypeDescription groupTypeDescription)

Method Summary

Modifier and TypeMethod and Description
public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldContainOnly
(Object
the actual value in the failed assertion.
actual
,
Object
values expected to be contained in actual.
expected
,
Iterable<?>
values in expected not found in actual.
notFound
,
Iterable<?>
values in actual that were not in expected.
notExpected
,
ComparisonStrategy
the ComparisonStrategy used to evaluate assertion.
comparisonStrategy
)

Creates a new ShouldContainOnly.

public static ErrorMessageFactory
shouldContainOnly(Object actual, Object expected, Iterable<?> notFound, Iterable<?> notExpected, GroupTypeDescription groupTypeDescription)

private static ErrorMessageFactory
shouldContainOnly(Object actual, Object expected, Iterable<?> notFound, Iterable<?> notExpected, ComparisonStrategy comparisonStrategy, GroupTypeDescription groupTypeDescription)

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldContainOnly
(Object
the actual value in the failed assertion.
actual
,
Object
values expected to be contained in actual.
expected
,
Iterable<?>
values in expected not found in actual.
notFound
,
Iterable<?>
values in actual that were not in expected.
notExpected
)

Creates a new ShouldContainOnly.

Inherited from org.assertj.core.error.BasicErrorMessageFactory:
createcreatecreateequalshashCodetoStringunquotedString

Constructor Detail

ShouldContainOnlyback to summary
private ShouldContainOnly(Object actual, Object expected, Iterable<?> notFound, Iterable<?> notExpected, ComparisonStrategy comparisonStrategy, GroupTypeDescription groupTypeDescription)
ShouldContainOnlyback to summary
private ShouldContainOnly(Object actual, Object expected, Iterable<?> notFoundOrNotExpected, ShouldContainOnly.ErrorType errorType, ComparisonStrategy comparisonStrategy, GroupTypeDescription groupTypeDescription)

Method Detail

shouldContainOnlyback to summary
public static ErrorMessageFactory shouldContainOnly(Object actual, Object expected, Iterable<?> notFound, Iterable<?> notExpected, ComparisonStrategy comparisonStrategy)

Creates a new ShouldContainOnly.

Parameters
actual:Object

the actual value in the failed assertion.

expected:Object

values expected to be contained in actual.

notFound:Iterable<?>

values in expected not found in actual.

notExpected:Iterable<?>

values in actual that were not in expected.

comparisonStrategy:ComparisonStrategy

the ComparisonStrategy used to evaluate assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldContainOnlyback to summary
public static ErrorMessageFactory shouldContainOnly(Object actual, Object expected, Iterable<?> notFound, Iterable<?> notExpected, GroupTypeDescription groupTypeDescription)
shouldContainOnlyback to summary
private static ErrorMessageFactory shouldContainOnly(Object actual, Object expected, Iterable<?> notFound, Iterable<?> notExpected, ComparisonStrategy comparisonStrategy, GroupTypeDescription groupTypeDescription)
shouldContainOnlyback to summary
public static ErrorMessageFactory shouldContainOnly(Object actual, Object expected, Iterable<?> notFound, Iterable<?> notExpected)

Creates a new ShouldContainOnly.

Parameters
actual:Object

the actual value in the failed assertion.

expected:Object

values expected to be contained in actual.

notFound:Iterable<?>

values in expected not found in actual.

notExpected:Iterable<?>

values in actual that were not in expected.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

org.assertj.core.error back to summary

public final Enum ShouldContainOnly.ErrorType

extends Enum<ShouldContainOnly.ErrorType>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final ShouldContainOnly.ErrorType
public static final ShouldContainOnly.ErrorType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ShouldContainOnly.ErrorType
public static ShouldContainOnly.ErrorType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

NOT_EXPECTED_ONLYback to summary
public static final ShouldContainOnly.ErrorType NOT_EXPECTED_ONLY
NOT_FOUND_ONLYback to summary
public static final ShouldContainOnly.ErrorType NOT_FOUND_ONLY

Constructor Detail

ErrorTypeback to summary
private ErrorType()

Method Detail

valueOfback to summary
public static ShouldContainOnly.ErrorType valueOf(String name)
valuesback to summary
public static ShouldContainOnly.ErrorType[] values()