Package org.assertj.core.error
Class ShouldOnlyHaveFields
- java.lang.Object
-
- org.assertj.core.error.BasicErrorMessageFactory
-
- org.assertj.core.error.ShouldOnlyHaveFields
-
- All Implemented Interfaces:
ErrorMessageFactory
public class ShouldOnlyHaveFields extends BasicErrorMessageFactory
Creates an error message indicating that an assertion that verifies that a class has only the fields.- Author:
- Filip Hrisafov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ShouldOnlyHaveFields.ErrorType
-
Field Summary
-
Fields inherited from class org.assertj.core.error.BasicErrorMessageFactory
arguments, format, formatter
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ShouldOnlyHaveFields(Class<?> actual, Collection<String> expected, Collection<String> notFound, Collection<String> notExpected, boolean declared)
private
ShouldOnlyHaveFields(Class<?> actual, Collection<String> expected, Collection<String> notFoundOrNotExpected, ShouldOnlyHaveFields.ErrorType errorType, boolean declared)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static ErrorMessageFactory
create(Class<?> actual, Collection<String> expected, Collection<String> notFound, Collection<String> notExpected, boolean declared)
static ErrorMessageFactory
shouldOnlyHaveDeclaredFields(Class<?> actual, Collection<String> expected, Collection<String> notFound, Collection<String> notExpected)
Creates a new
.ShouldOnlyHaveFields
static ErrorMessageFactory
shouldOnlyHaveFields(Class<?> actual, Collection<String> expected, Collection<String> notFound, Collection<String> notExpected)
Creates a new
.ShouldOnlyHaveFields
-
Methods inherited from class org.assertj.core.error.BasicErrorMessageFactory
create, create, create, equals, hashCode, toString, unquotedString
-
-
-
-
Constructor Detail
-
ShouldOnlyHaveFields
private ShouldOnlyHaveFields(Class<?> actual, Collection<String> expected, Collection<String> notFound, Collection<String> notExpected, boolean declared)
-
ShouldOnlyHaveFields
private ShouldOnlyHaveFields(Class<?> actual, Collection<String> expected, Collection<String> notFoundOrNotExpected, ShouldOnlyHaveFields.ErrorType errorType, boolean declared)
-
-
Method Detail
-
shouldOnlyHaveFields
public static ErrorMessageFactory shouldOnlyHaveFields(Class<?> actual, Collection<String> expected, Collection<String> notFound, Collection<String> notExpected)
Creates a new
.ShouldOnlyHaveFields
- Parameters:
actual
- the actual value in the failed assertion.expected
- expected fields for this classnotFound
- fields inexpected
not found in theactual
.notExpected
- fields in theactual
that were not inexpected
.- Returns:
- the created
ErrorMessageFactory
.
-
shouldOnlyHaveDeclaredFields
public static ErrorMessageFactory shouldOnlyHaveDeclaredFields(Class<?> actual, Collection<String> expected, Collection<String> notFound, Collection<String> notExpected)
Creates a new
.ShouldOnlyHaveFields
- Parameters:
actual
- the actual value in the failed assertion.expected
- expected fields for this classnotFound
- fields inexpected
not found in theactual
.notExpected
- fields in theactual
that were not inexpected
.- Returns:
- the created
ErrorMessageFactory
.
-
create
private static ErrorMessageFactory create(Class<?> actual, Collection<String> expected, Collection<String> notFound, Collection<String> notExpected, boolean declared)
-
-