java.lang.Object
com.iqser.red.service.redaction.v1.server.model.document.entity.MatchedRule
All Implemented Interfaces:
Comparable<MatchedRule>

public final class MatchedRule extends Object implements Comparable<MatchedRule>
Represents a rule that has been matched during the document redaction process.
  • Field Details

    • FINAL_TYPE

      public static final com.iqser.red.service.redaction.v1.server.model.drools.RuleType FINAL_TYPE
    • ELIMINATION_RULE_TYPE

      public static final com.iqser.red.service.redaction.v1.server.model.drools.RuleType ELIMINATION_RULE_TYPE
    • IMPORTED_TYPE

      public static final com.iqser.red.service.redaction.v1.server.model.drools.RuleType IMPORTED_TYPE
    • DICTIONARY_TYPE

      public static final com.iqser.red.service.redaction.v1.server.model.drools.RuleType DICTIONARY_TYPE
  • Constructor Details

    • MatchedRule

      public MatchedRule(com.iqser.red.service.redaction.v1.server.model.drools.RuleIdentifier ruleIdentifier, String reason, String legalBasis, boolean writeValueWithLineBreaks, boolean applied, boolean removed, boolean ignored, Set<com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity> references)
  • Method Details

    • empty

      public static MatchedRule empty()
      Creates an empty instance of MatchedRule. This can be used as a placeholder or when no rule is actually matched.
      Returns:
      An empty MatchedRule instance.
    • asSkippedIfApplied

      public MatchedRule asSkippedIfApplied()
      Returns a modified instance of MatchedRule based on its applied status. If the rule has been applied, it returns a new MatchedRule instance that retains all properties of the original except for the 'applied' status, which is set to false. If the rule has not been applied, it returns the original instance.
      Returns:
      A MatchedRule instance with 'applied' set to false.
    • compareTo

      public int compareTo(MatchedRule matchedRule)
      Compares this rule with another MatchedRule to establish a priority order. The comparison is based on the rule type, unit, and ID, in that order.
      Specified by:
      compareTo in interface Comparable<MatchedRule>
      Parameters:
      matchedRule - The MatchedRule to compare against.
      Returns:
      A negative integer, zero, or a positive integer as this rule is less than, equal to, or greater than the specified rule.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static MatchedRule.MatchedRuleBuilder builder()
    • getRuleIdentifier

      public com.iqser.red.service.redaction.v1.server.model.drools.RuleIdentifier getRuleIdentifier()
    • getReason

      public String getReason()
    • getLegalBasis

      public String getLegalBasis()
    • isWriteValueWithLineBreaks

      public boolean isWriteValueWithLineBreaks()
    • isApplied

      public boolean isApplied()
    • isRemoved

      public boolean isRemoved()
    • isIgnored

      public boolean isIgnored()
    • getReferences

      public Set<com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity> getReferences()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object