Class MatchedRule
java.lang.Object
com.iqser.red.service.redaction.v1.server.model.document.entity.MatchedRule
- All Implemented Interfaces:
Comparable<MatchedRule>
Represents a rule that has been matched during the document redaction process.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.iqser.red.service.redaction.v1.server.model.drools.RuleType
static final com.iqser.red.service.redaction.v1.server.model.drools.RuleType
static final com.iqser.red.service.redaction.v1.server.model.drools.RuleType
static final com.iqser.red.service.redaction.v1.server.model.drools.RuleType
-
Constructor Summary
ConstructorsConstructorDescriptionMatchedRule
(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 Summary
Modifier and TypeMethodDescriptionReturns a modified instance ofMatchedRule
based on its applied status.builder()
int
compareTo
(MatchedRule matchedRule) Compares this rule with anotherMatchedRule
to establish a priority order.static MatchedRule
empty()
Creates an empty instance ofMatchedRule
.boolean
Set<com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity>
com.iqser.red.service.redaction.v1.server.model.drools.RuleIdentifier
int
hashCode()
boolean
boolean
boolean
boolean
toString()
-
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
Creates an empty instance ofMatchedRule
. This can be used as a placeholder or when no rule is actually matched.- Returns:
- An empty
MatchedRule
instance.
-
asSkippedIfApplied
Returns a modified instance ofMatchedRule
based on its applied status. If the rule has been applied, it returns a newMatchedRule
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
Compares this rule with anotherMatchedRule
to establish a priority order. The comparison is based on the rule type, unit, and ID, in that order.- Specified by:
compareTo
in interfaceComparable<MatchedRule>
- Parameters:
matchedRule
- TheMatchedRule
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
-
builder
-
getRuleIdentifier
public com.iqser.red.service.redaction.v1.server.model.drools.RuleIdentifier getRuleIdentifier() -
getReason
-
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
-
hashCode
public int hashCode()
-