Class 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.
    • 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 error message with the fieldLocation.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • FieldMessages

        public FieldMessages()
    • Method Detail

      • registerMessage

        public void registerMessage​(java.lang.String fieldLocation,
                                    java.lang.String message)
        Pairs the giving error message with the fieldLocation.
        Parameters:
        fieldLocation - the field location where to apply the giving error message
        message - 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