Top Description Fields Constructors Methods
org.assertj.core.api.recursive.comparison

public Class FieldMessages

extends FieldHolder<String>
Class Inheritance
Imports
java.util.Map.Entry, java.util.stream.Stream

An internal holder of the custom messages for fields described by their path without element index.

Field Summary

Inherited from org.assertj.core.api.recursive.comparison.FieldHolder:
fieldHolder

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

a custom message or null
getMessageForField
(String
the field location that has to be associated with a message
fieldLocation
)

Retrieves a custom message, which is associated with the giving field location.

public boolean

Returns:

is field location contain a custom message
hasMessageForField
(String
the field location which association need to check
fieldLocation
)

Checks, whether an any custom message is associated with the giving field location.

public Stream<Map.Entry<String, String>>

Returns:

sequence of field-message pairs
messageByFields
()

Returns a sequence of associated field-message pairs.

public void
registerMessage(String
the field location where to apply the giving error message
fieldLocation
,
String
the error message
message
)

Pairs the giving error message with the fieldLocation.

Inherited from org.assertj.core.api.recursive.comparison.FieldHolder:
entryByFieldequalsgethasEntityhashCodeisEmptyputtoString

Constructor Detail

FieldMessagesback to summary
public FieldMessages()

Method Detail

getMessageForFieldback to summary
public String getMessageForField(String fieldLocation)

Retrieves a custom message, which is associated with the giving field location. If this location does not associate with any custom message - this method returns null.

Parameters
fieldLocation:String

the field location that has to be associated with a message

Returns:String

a custom message or null

hasMessageForFieldback to summary
public boolean hasMessageForField(String fieldLocation)

Checks, whether an any custom message is associated with the giving field location.

Parameters
fieldLocation:String

the field location which association need to check

Returns:boolean

is field location contain a custom message

messageByFieldsback to summary
public Stream<Map.Entry<String, String>> messageByFields()

Returns a sequence of associated field-message pairs.

Returns:Stream<Map.Entry<String, String>>

sequence of field-message pairs

registerMessageback to summary
public void registerMessage(String fieldLocation, String message)

Pairs the giving error message with the fieldLocation.

Parameters
fieldLocation:String

the field location where to apply the giving error message

message:String

the error message