Class DateValidationRules

java.lang.Object
org.strassburger.tui4j.input.validationrules.DateValidationRules

public class DateValidationRules extends Object
  • Constructor Details

    • DateValidationRules

      public DateValidationRules()
  • Method Details

    • futureDate

      public static ValidationRule<Date> futureDate()
      Returns a validation rule that checks if the date is in the future.
      Returns:
      A validation rule that checks if the date is in the future.
    • futureDate

      public static ValidationRule<Date> futureDate(String errorMessage)
      Returns a validation rule that checks if the date is in the future with a custom string error message.
      Parameters:
      errorMessage - The error message to display if the validation fails.
      Returns:
      A validation rule that checks if the date is in the future.
    • futureDate

      public static ValidationRule<Date> futureDate(StyledText errorMessage)
      Returns a validation rule that checks if the date is in the future with a custom styled error message.
      Parameters:
      errorMessage - The styled error message to display if the validation fails.
      Returns:
      A validation rule that checks if the date is in the future.
    • pastDate

      public static ValidationRule<Date> pastDate()
      Returns a validation rule that checks if the date is in the past.
      Returns:
      A validation rule that checks if the date is in the past.
    • pastDate

      public static ValidationRule<Date> pastDate(String errorMessage)
      Returns a validation rule that checks if the date is in the past with a custom string error message.
      Parameters:
      errorMessage - The error message to display if the validation fails.
      Returns:
      A validation rule that checks if the date is in the past.
    • pastDate

      public static ValidationRule<Date> pastDate(StyledText errorMessage)
      Returns a validation rule that checks if the date is in the past with a custom styled error message.
      Parameters:
      errorMessage - The styled error message to display if the validation fails.
      Returns:
      A validation rule that checks if the date is in the past.
    • after

      public static ValidationRule<Date> after(Date date)
      Returns a validation rule that checks if the date is after a specified date.
      Parameters:
      date - The date to compare against.
      Returns:
      A validation rule that checks if the date is after the specified date.
    • after

      public static ValidationRule<Date> after(Date date, String errorMessage)
      Returns a validation rule that checks if the date is after a specified date with a custom string error message.
      Parameters:
      date - The date to compare against.
      errorMessage - The error message to display if the validation fails.
      Returns:
      A validation rule that checks if the date is after the specified date.
    • after

      public static ValidationRule<Date> after(Date date, StyledText errorMessage)
      Returns a validation rule that checks if the date is after a specified date with a custom styled error message.
      Parameters:
      date - The date to compare against.
      errorMessage - The styled error message to display if the validation fails.
      Returns:
      A validation rule that checks if the date is after the specified date.
    • before

      public static ValidationRule<Date> before(Date date)
      Returns a validation rule that checks if the date is before a specified date.
      Parameters:
      date - The date to compare against.
      Returns:
      A validation rule that checks if the date is before the specified date.
    • before

      public static ValidationRule<Date> before(Date date, String errorMessage)
      Returns a validation rule that checks if the date is before a specified date with a custom string error message.
      Parameters:
      date - The date to compare against.
      errorMessage - The error message to display if the validation fails.
      Returns:
      A validation rule that checks if the date is before the specified date.
    • before

      public static ValidationRule<Date> before(Date date, StyledText errorMessage)
      Returns a validation rule that checks if the date is before a specified date with a custom styled error message.
      Parameters:
      date - The date to compare against.
      errorMessage - The styled error message to display if the validation fails.
      Returns:
      A validation rule that checks if the date is before the specified date.