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 java.lang.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(java.util.List<? extends SearchFilter> filters, ChainedSearchFilter.Operator logicOperator)
          Constructs a chained search filter.
ChainedSearchFilter(java.util.List<? extends SearchFilter> filters, java.util.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(java.lang.Object obj)
           
 java.util.List<SearchFilter> getFilters()
           
 java.lang.String getKey()
           
 java.util.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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChainedSearchFilter

public ChainedSearchFilter(java.util.List<? extends SearchFilter> filters,
                           java.util.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:
java.lang.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(java.util.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:
java.lang.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 java.util.List<SearchFilter> getFilters()

getOperators

public java.util.List<ChainedSearchFilter.Operator> getOperators()

getKey

public java.lang.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(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2003-2010 Atlassian. All Rights Reserved.