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

public Class ShouldOnlyHaveFields

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

Creates an error message indicating that an assertion that verifies that a class has only the fields.
Author
Filip Hrisafov

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

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

Constructor Summary

AccessConstructor and 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

Modifier and TypeMethod and Description
private static ErrorMessageFactory
create(Class<?> actual, Collection<String> expected, Collection<String> notFound, Collection<String> notExpected, boolean declared)

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldOnlyHaveDeclaredFields
(Class<?>
the actual value in the failed assertion.
actual
,
Collection<String>
expected fields for this class
expected
,
Collection<String>
fields in expected not found in the actual.
notFound
,
Collection<String>
fields in the actual that were not in expected.
notExpected
)

Creates a new ShouldOnlyHaveFields.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldOnlyHaveFields
(Class<?>
the actual value in the failed assertion.
actual
,
Collection<String>
expected fields for this class
expected
,
Collection<String>
fields in expected not found in the actual.
notFound
,
Collection<String>
fields in the actual that were not in expected.
notExpected
)

Creates a new ShouldOnlyHaveFields.

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

Constructor Detail

ShouldOnlyHaveFieldsback to summary
private ShouldOnlyHaveFields(Class<?> actual, Collection<String> expected, Collection<String> notFound, Collection<String> notExpected, boolean declared)
ShouldOnlyHaveFieldsback to summary
private ShouldOnlyHaveFields(Class<?> actual, Collection<String> expected, Collection<String> notFoundOrNotExpected, ShouldOnlyHaveFields.ErrorType errorType, boolean declared)

Method Detail

createback to summary
private static ErrorMessageFactory create(Class<?> actual, Collection<String> expected, Collection<String> notFound, Collection<String> notExpected, boolean declared)
shouldOnlyHaveDeclaredFieldsback to summary
public static ErrorMessageFactory shouldOnlyHaveDeclaredFields(Class<?> actual, Collection<String> expected, Collection<String> notFound, Collection<String> notExpected)

Creates a new ShouldOnlyHaveFields.

Parameters
actual:Class<?>

the actual value in the failed assertion.

expected:Collection<String>

expected fields for this class

notFound:Collection<String>

fields in expected not found in the actual.

notExpected:Collection<String>

fields in the actual that were not in expected.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldOnlyHaveFieldsback to summary
public static ErrorMessageFactory shouldOnlyHaveFields(Class<?> actual, Collection<String> expected, Collection<String> notFound, Collection<String> notExpected)

Creates a new ShouldOnlyHaveFields.

Parameters
actual:Class<?>

the actual value in the failed assertion.

expected:Collection<String>

expected fields for this class

notFound:Collection<String>

fields in expected not found in the actual.

notExpected:Collection<String>

fields in the actual that were not in expected.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

org.assertj.core.error back to summary

pack-priv final Enum ShouldOnlyHaveFields.ErrorType

extends Enum<ShouldOnlyHaveFields.ErrorType>
Class Inheritance

Field Summary

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

Constructor Summary

AccessConstructor and Description
private

Method Summary

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

Field Detail

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

Constructor Detail

ErrorTypeback to summary
private ErrorType()

Method Detail

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