org.sonar.api.web
Class Filter

java.lang.Object
  extended by org.sonar.api.web.Filter

public final class Filter
extends Object

Definition of a filter.

Its name can be retrieved using the i18n mechanism, using the keys "filter.<id>.name".

Since:
3.1

Field Summary
static String LIST
           
static String TREEMAP
           
 
Method Summary
 Filter add(Criterion criterion)
          Add a Criterion to the list used to narrow down the results of this Filter.
 Filter add(FilterColumn column)
          Add a FilterColumn to the list of columns displayed by this Filter.
static Filter create()
          Creates a new Filter.
 List<FilterColumn> getColumns()
          Get the list of FilterColumn displayed by this Filter.
 List<Criterion> getCriteria()
          Get the list of Criterion used to narrow down the results of this Filter.
 String getDisplayAs()
          Get the type of display used by this Filter.
 int getPageSize()
          Get the size of a page displayed this Filter.
 boolean isFavouritesOnly()
          The Filter can be configured to return only favourites.
 Filter setDisplayAs(String displayAs)
          Set the type of display used by this Filter.
 Filter setFavouritesOnly(boolean favouritesOnly)
          The Filter can be configured to return only favourites.
 Filter setPageSize(int pageSize)
          Set the size of a page displayed this Filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIST

public static final String LIST
See Also:
Constant Field Values

TREEMAP

public static final String TREEMAP
See Also:
Constant Field Values
Method Detail

create

public static Filter create()
Creates a new Filter.


getCriteria

public List<Criterion> getCriteria()
Get the list of Criterion used to narrow down the results of this Filter.

Returns:
the criteria

add

public Filter add(Criterion criterion)
Add a Criterion to the list used to narrow down the results of this Filter.

Returns:
this filter

getColumns

public List<FilterColumn> getColumns()
Get the list of FilterColumn displayed by this Filter.

Returns:
this columns

add

public Filter add(FilterColumn column)
Add a FilterColumn to the list of columns displayed by this Filter.

Returns:
this filter

isFavouritesOnly

public boolean isFavouritesOnly()
The Filter can be configured to return only favourites.

Returns:
true if favourites only are returned

setFavouritesOnly

public Filter setFavouritesOnly(boolean favouritesOnly)
The Filter can be configured to return only favourites.


getDisplayAs

public String getDisplayAs()
Get the type of display used by this Filter.

Can be either #LIST or #TREEMAP

Returns:
the display type

setDisplayAs

public Filter setDisplayAs(String displayAs)
Set the type of display used by this Filter.

Can be either #LIST or #TREEMAP

Returns:
this filter
Throws:
IllegalArgumentException - if displayAs is not #LIST or #TREEMAP

getPageSize

public int getPageSize()
Get the size of a page displayed this Filter.

The page size is between 20 and 200 (included)

Returns:
the display type

setPageSize

public Filter setPageSize(int pageSize)
Set the size of a page displayed this Filter.

The page size should be between 20 and 200 (included)

Returns:
the display type
Throws:
IllegalArgumentException - if pageSize is not lower than 20 or greater than 200


Copyright © 2009–2016 SonarSource. All rights reserved.