Class OtpFieldI18n

java.lang.Object
com.flowingcode.vaadin.addons.otpfield.OtpFieldI18n
All Implemented Interfaces:
Serializable

public class OtpFieldI18n extends Object implements Serializable
The internationalization properties of an OtpField: the error messages of its three built-in constraints.

All three messages have an English default, so an unconfigured field never shows an empty error. Note that an error message set with HasValidationProperties.setErrorMessage(String) takes priority over these messages.

Since:
1.0.0
Author:
Flowing Code
See Also:
  • Constructor Details

    • OtpFieldI18n

      public OtpFieldI18n()
  • Method Details

    • getRequiredErrorMessage

      public String getRequiredErrorMessage()
      Gets the error message displayed when the field is required but empty.
      Returns:
      the error message, or null if it was cleared
      See Also:
    • setRequiredErrorMessage

      public OtpFieldI18n setRequiredErrorMessage(String errorMessage)
      Sets the error message to display when the field is required but empty.
      Parameters:
      errorMessage - the error message, or null to clear it
      Returns:
      this instance, for method chaining
      See Also:
    • getIncompleteErrorMessage

      public String getIncompleteErrorMessage()
      Gets the error message displayed when the code is non-empty but shorter than the length of the field.
      Returns:
      the error message, or null if it was cleared
      See Also:
    • setIncompleteErrorMessage

      public OtpFieldI18n setIncompleteErrorMessage(String errorMessage)
      Sets the error message to display when the code is non-empty but shorter than the length of the field.
      Parameters:
      errorMessage - the error message, or null to clear it
      Returns:
      this instance, for method chaining
      See Also:
    • getInvalidErrorMessage

      public String getInvalidErrorMessage()
      Gets the error message displayed when the code is longer than the length of the field, or contains characters the field does not accept.
      Returns:
      the error message, or null if it was cleared
      See Also:
    • setInvalidErrorMessage

      public OtpFieldI18n setInvalidErrorMessage(String errorMessage)
      Sets the error message to display when the code is longer than the length of the field, or contains characters the field does not accept.

      A user cannot enter such a value, so this message reports a value that was set programmatically, typically a stored code that no longer fits the configuration of the field.

      Parameters:
      errorMessage - the error message, or null to clear it
      Returns:
      this instance, for method chaining
      See Also: