Class AttributeFilter

java.lang.Object
io.fluentlenium.core.filter.AttributeFilter
All Implemented Interfaces:
SearchFilter

public class AttributeFilter extends Object implements SearchFilter
Search filter based on attribute value.
  • Constructor Details

    • AttributeFilter

      public AttributeFilter(String attributeName, String value)
      Construct a filter with an attribute name and an associated value
      Parameters:
      attributeName - attribute name
      value - value to filter
    • AttributeFilter

      public AttributeFilter(String customAttribute, AbstractMatcher matcher)
      Construct a filter with a custom attribute and an associated matcher
      Parameters:
      customAttribute - custom attribute name
      matcher - matcher
  • Method Details

    • getAttribute

      public String getAttribute()
      Get the attribute name (lower case).
      Returns:
      attribute name (lower case)
    • getMatcher

      public AbstractMatcher getMatcher()
      Get the matcher of this filter
      Returns:
      matcher
    • toString

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

      public String getCssFilter()
      Description copied from interface: SearchFilter
      Get the CSS string used by CSS search time filtering.
      Specified by:
      getCssFilter in interface SearchFilter
      Returns:
      css filter string
    • isCssFilterSupported

      public boolean isCssFilterSupported()
      Description copied from interface: SearchFilter
      Does this filter support filtering at search time with CSS selector.
      Specified by:
      isCssFilterSupported in interface SearchFilter
      Returns:
      true if CSS filtering is supported, else false
    • applyFilter

      public Collection<FluentWebElement> applyFilter(Collection<FluentWebElement> elements)
      Description copied from interface: SearchFilter
      Apply the filter.
      Specified by:
      applyFilter in interface SearchFilter
      Parameters:
      elements - input elements
      Returns:
      filtered elements