Class FieldMessages
- java.lang.Object
-
- org.assertj.core.api.recursive.comparison.FieldHolder<java.lang.String>
-
- org.assertj.core.api.recursive.comparison.FieldMessages
-
public class FieldMessages extends FieldHolder<java.lang.String>
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 Constructor Description FieldMessages()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getMessageForField(java.lang.String fieldLocation)
Retrieves a custom message, which is associated with the giving field location.boolean
hasMessageForField(java.lang.String fieldLocation)
Checks, whether an any custom message is associated with the giving field location.java.util.stream.Stream<java.util.Map.Entry<java.lang.String,java.lang.String>>
messageByFields()
Returns a sequence of associated field-message pairs.void
registerMessage(java.lang.String fieldLocation, java.lang.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
-
-
-
-
Method Detail
-
registerMessage
public void registerMessage(java.lang.String fieldLocation, java.lang.String message)
Pairs the giving errormessage
with thefieldLocation
.- Parameters:
fieldLocation
- the field location where to apply the giving error messagemessage
- the error message
-
hasMessageForField
public boolean hasMessageForField(java.lang.String fieldLocation)
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
public java.lang.String getMessageForField(java.lang.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
- the field location that has to be associated with a message- Returns:
- a custom message or null
-
messageByFields
public java.util.stream.Stream<java.util.Map.Entry<java.lang.String,java.lang.String>> messageByFields()
Returns a sequence of associated field-message pairs.- Returns:
- sequence of field-message pairs
-
-