Class AttributeFilter
java.lang.Object
com.aquima.interactions.matching.request.AttributeFilter
- All Implemented Interfaces:
IAttributeFilter
Default attribute filter implementation that can be used to exclude attributes by name.
- Since:
- 6.2
- Author:
- O. Kerpershoek, F. van der Meer
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs the attribute filter with the ignore-exceptions property set to false and the ignore relations set to true.AttributeFilter
(boolean ignoreExceptions, boolean ignoreRelations) Constructs the attribute filter with a boolean indicating if exceptions should be ignored. -
Method Summary
Modifier and TypeMethodDescriptionvoid
excludeAttribute
(String entityName, String attributeName) This method may be used to define an attribute that should be excluded from the match request.boolean
includeAttribute
(IEntityInstance instance, IAttributeDefinition attribute) This method will be invoked before a value is copied to the match request.void
onException
(IAttributeDefinition attribute, Exception error) This method is invoked when an exception occurs while adding an attribute value to the match request.
-
Constructor Details
-
AttributeFilter
public AttributeFilter()Constructs the attribute filter with the ignore-exceptions property set to false and the ignore relations set to true. -
AttributeFilter
public AttributeFilter(boolean ignoreExceptions, boolean ignoreRelations) Constructs the attribute filter with a boolean indicating if exceptions should be ignored.- Parameters:
ignoreExceptions
- Boolean indicating if exceptions should be ignored.ignoreRelations
- Boolean indicating if relation attributes should be ignored.
-
-
Method Details
-
excludeAttribute
This method may be used to define an attribute that should be excluded from the match request.- Parameters:
entityName
- The name of the entity whose attribute should be excluded.attributeName
- The name of the attribute that should be excluded.
-
includeAttribute
Description copied from interface:IAttributeFilter
This method will be invoked before a value is copied to the match request. This method should return true when the attribute value should be matched, or false when the attribute value should be excluded from the match request.- Specified by:
includeAttribute
in interfaceIAttributeFilter
- Parameters:
instance
- The instance the attribute belongs to.attribute
- The attribute whose value should be copied.- Returns:
- Boolean indicating if the value for the specified attribute should be copied to the match request.
-
onException
Description copied from interface:IAttributeFilter
This method is invoked when an exception occurs while adding an attribute value to the match request. This method may either ignore the error, usually logging it, or re-throw the exception to indicate the match request could not be created.- Specified by:
onException
in interfaceIAttributeFilter
- Parameters:
attribute
- The attribute that was being processed when the exception occurred.error
- The exception that occurred while copying the attribute value.
-