Module ical4j.core

Class ValidationRule<T>

java.lang.Object
net.fortuna.ical4j.validate.ValidationRule<T>
All Implemented Interfaces:
Serializable

public class ValidationRule<T> extends Object implements Serializable
Defines a rule for validating iCalendar content. A rule consists of a validation type (e.g. presence/absence of specific content), and one or more identifiers (names) of iCalendar content. For example, a rule might define a test for one or less DTEND properties using the "OneOrLess" validation type and "DTEND" identifier. Alternatively, a Predicate may be specified to provide additional validation beyond the presence/absence of content. For example, a predicate may be used to ensure certain date properties are DATE/DATE-TIME values. Note that the predicate must specify the negative case, such that if it evaluates true the rule fails.
See Also:
  • Constructor Details

    • ValidationRule

      public ValidationRule(ValidationRule.ValidationType type, String... instances)
      Parameters:
      type - rule type
      instances - list of identifiers to check (parameter, property, component, etc.)
    • ValidationRule

      public ValidationRule(ValidationRule.ValidationType type, boolean relaxedModeSupported, String... instances)
      Parameters:
      type - rule type
      relaxedModeSupported - indicates if rule can be ignored when relaxed mode is enabled
      instances - list of identifiers to check (parameter, property, component, etc.)
    • ValidationRule

      public ValidationRule(Predicate<T> predicate, String message, String... instances)
      Parameters:
      predicate - a negative predicate, such that a successful test indicates a rule violation
      message - the message used to indicate a rule violation
      instances - identifiers for instances under test
    • ValidationRule

      public ValidationRule(Predicate<T> predicate, String message, boolean relaxedModeSupported, String... instances)
  • Method Details