Class FieldMessages
java.lang.Object
org.assertj.core.api.recursive.comparison.FieldHolder<String>
org.assertj.core.api.recursive.comparison.FieldMessages
An internal holder of the custom messages for fields described by their path without element index.
-
Field Summary
Fields inherited from class org.assertj.core.api.recursive.comparison.FieldHolder
fieldHolder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetMessageForField
(String fieldLocation) Retrieves a custom message, which is associated with the giving field location.boolean
hasMessageForField
(String fieldLocation) Checks, whether an any custom message is associated with the giving field location.Returns a sequence of associated field-message pairs.void
registerMessage
(String fieldLocation, String message) Pairs the giving errormessage
with thefieldLocation
.Methods inherited from class org.assertj.core.api.recursive.comparison.FieldHolder
entryByField, equals, get, hasEntity, hashCode, isEmpty, put, toString
-
Constructor Details
-
FieldMessages
public FieldMessages()
-
-
Method Details
-
registerMessage
Pairs the giving errormessage
with thefieldLocation
.- Parameters:
fieldLocation
- the field location where to apply the giving error messagemessage
- the error message
-
hasMessageForField
Checks, whether an any custom message is associated with the giving field location.- Parameters:
fieldLocation
- the field location which association need to check- Returns:
- is field location contain a custom message
-
getMessageForField
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
- the field location that has to be associated with a message- Returns:
- a custom message or null
-
messageByFields
Returns a sequence of associated field-message pairs.- Returns:
- sequence of field-message pairs
-