Class AttributeFilter

java.lang.Object
com.aquima.interactions.matching.request.AttributeFilter
All Implemented Interfaces:
IAttributeFilter

public class AttributeFilter extends Object implements 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 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

      public void excludeAttribute(String entityName, String attributeName)
      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

      public boolean includeAttribute(IEntityInstance instance, IAttributeDefinition attribute)
      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 interface IAttributeFilter
      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

      public void onException(IAttributeDefinition attribute, Exception error)
      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 interface IAttributeFilter
      Parameters:
      attribute - The attribute that was being processed when the exception occurred.
      error - The exception that occurred while copying the attribute value.