com.atlassian.confluence.search.v2.searchfilter
Class ChainedSearchFilter

java.lang.Object
  extended by com.atlassian.confluence.search.v2.searchfilter.ChainedSearchFilter
All Implemented Interfaces:
SearchFilter

@Immutable
public class ChainedSearchFilter
extends Object
implements SearchFilter

Allows multiple SearchFilters to be chained together, with the option to specify the logical operator to apply between them.


Nested Class Summary
static class ChainedSearchFilter.Operator
          Logic operator to allow clients to specify whether to apply a logical AND or OR between the result of filters
 
Constructor Summary
ChainedSearchFilter(List<? extends SearchFilter> filters, ChainedSearchFilter.Operator logicOperator)
          Constructs a chained search filter.
ChainedSearchFilter(List<? extends SearchFilter> filters, List<ChainedSearchFilter.Operator> logicOperators)
          Constructs a chained search filter.
ChainedSearchFilter(SearchFilter... filters)
          Constructs a chained search filter that AND's the list of specified filters.
 
Method Summary
 ChainedSearchFilter and(SearchFilter other)
          Combines this filter with the one specified, returning a new filter.
 boolean equals(Object obj)
           
 List<SearchFilter> getFilters()
           
 String getKey()
           
 List<ChainedSearchFilter.Operator> getOperators()
           
 int hashCode()
           
 ChainedSearchFilter merge(ChainedSearchFilter other)
           
 ChainedSearchFilter or(SearchFilter other)
          Combines this filter with the one specified, returning a new filter.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChainedSearchFilter

public ChainedSearchFilter(List<? extends SearchFilter> filters,
                           List<ChainedSearchFilter.Operator> logicOperators)
Constructs a chained search filter.

Parameters:
filters - the filters. Nested ChainedSearchFilter not supported.
logicOperators - the operator to appy for the corresponding filter
Throws:
IllegalArgumentException - if specified filters is null or empty or if the size of filters differs from the size of logicOperators or if one of the filters specified is a ChainedSearchFilter

ChainedSearchFilter

public ChainedSearchFilter(List<? extends SearchFilter> filters,
                           ChainedSearchFilter.Operator logicOperator)
Constructs a chained search filter.

Parameters:
filters - the filters. Nested ChainedSearchFilter not supported.
logicOperator - operator to apply to all filters
Throws:
IllegalArgumentException - if specified filters is null or empty or if one of the filters specified is a ChainedSearchFilter

ChainedSearchFilter

public ChainedSearchFilter(SearchFilter... filters)
Constructs a chained search filter that AND's the list of specified filters.

Parameters:
filters - the filters. Nested ChainedSearchFilter not supported.
Method Detail

getFilters

public List<SearchFilter> getFilters()

getOperators

public List<ChainedSearchFilter.Operator> getOperators()

getKey

public String getKey()
Specified by:
getKey in interface SearchFilter
Returns:
the plugin key

merge

public ChainedSearchFilter merge(ChainedSearchFilter other)
Returns:
a new chained search filter that merges this and other. If other is this or null or empty, returns this.

and

public ChainedSearchFilter and(SearchFilter other)
Description copied from interface: SearchFilter
Combines this filter with the one specified, returning a new filter. To pass the new filter, matches to both the original filters are required.

Specified by:
and in interface SearchFilter
Parameters:
other - the other filter.
Returns:
a new filter

or

public ChainedSearchFilter or(SearchFilter other)
Description copied from interface: SearchFilter
Combines this filter with the one specified, returning a new filter. To pass the new filter, there must be a match in at least one of the original filters.

Specified by:
or in interface SearchFilter
Parameters:
other - the other filter
Returns:
a new filter

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003–2015 Atlassian. All rights reserved.