Class FieldMessages
- java.lang.Object
-
- org.assertj.core.api.recursive.comparison.FieldHolder<String>
-
- org.assertj.core.api.recursive.comparison.FieldMessages
-
public class FieldMessages extends FieldHolder<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 StringgetMessageForField(String fieldLocation)Retrieves a custom message, which is associated with the giving field location.booleanhasMessageForField(String fieldLocation)Checks, whether an any custom message is associated with the giving field location.Stream<Map.Entry<String,String>>messageByFields()Returns a sequence of associated field-message pairs.voidregisterMessage(String fieldLocation, String message)Pairs the giving errormessagewith 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(String fieldLocation, String message)
Pairs the giving errormessagewith thefieldLocation.- Parameters:
fieldLocation- the field location where to apply the giving error messagemessage- the error message
-
hasMessageForField
public boolean hasMessageForField(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 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- the field location that has to be associated with a message- Returns:
- a custom message or null
-
-