Package su.onno.ui

Record Class FormFeedback

java.lang.Object
java.lang.Record
su.onno.ui.FormFeedback

public record FormFeedback(FormFeedbackSeverity severity, String field, String message) extends Record
One message returned by a FormValidator. A blank field targets the whole form; a field name (including a path such as participants.employee) places the message beside that control as well as exposing it to assistive technology.
  • Constructor Details

    • FormFeedback

      public FormFeedback(FormFeedbackSeverity severity, String field, String message)
      Creates an instance of a FormFeedback record class.
      Parameters:
      severity - the value for the severity record component
      field - the value for the field record component
      message - the value for the message record component
  • Method Details

    • error

      public static FormFeedback error(String field, String message)
    • warning

      public static FormFeedback warning(String field, String message)
    • info

      public static FormFeedback info(String field, String message)
    • formError

      public static FormFeedback formError(String message)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • severity

      public FormFeedbackSeverity severity()
      Returns the value of the severity record component.
      Returns:
      the value of the severity record component
    • field

      public String field()
      Returns the value of the field record component.
      Returns:
      the value of the field record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component