Class FieldMessages
java.lang.Object
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a sequence of all field-entry pairs which the current holder supplies.boolean
Retrieves a specific entity which is associated with the givingfiledLocation
from the field holder, if it presents.getMessageForField
(String fieldLocation) Retrieves a custom message, which is associated with the giving field location.boolean
Checks, whether an any entity associated with the giving field location.int
hashCode()
boolean
hasMessageForField
(String fieldLocation) Checks, whether an any custom message is associated with the giving field location.boolean
isEmpty()
Returns a sequence of associated field-message pairs.void
Pairs the givingentity
with thefieldLocation
.void
registerMessage
(String fieldLocation, String message) Pairs the giving errormessage
with thefieldLocation
.toString()
-
Field Details
-
fieldHolder
-
-
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
-
put
Pairs the givingentity
with thefieldLocation
.- Parameters:
fieldLocation
- the field location where to apply the giving entityentity
- the entity to pair
-
get
Retrieves a specific entity which is associated with the givingfiledLocation
from the field holder, if it presents. Otherwise, this method returnsnull
.- Parameters:
fieldLocation
- the field location which has to be associated with an entity- Returns:
- entity or null
-
hasEntity
Checks, whether an any entity associated with the giving field location.- Parameters:
fieldLocation
- the field location which association need to check- Returns:
- is entity associated with field location
-
isEmpty
public boolean isEmpty()- Returns:
true
is there are registered entities,false
otherwise
-
entryByField
Returns a sequence of all field-entry pairs which the current holder supplies.- Returns:
- sequence of field-entry pairs
-
toString
-
equals
-
hashCode
public int hashCode()
-