# Google Data APIs Client Library (1.43.0)

## com.google.gdata.client
Class Query.CategoryFilter

    java.lang.Object
      com.google.gdata.client.Query.CategoryFilter

Enclosing class:
  Query

    public static class Query.CategoryFilter

extends java.lang.Object

The CategoryFilter class is used to define sets of category conditions that must be met in order for an entry to match.

The CategoryFilter can contain multiple category criteria (inclusive or exclusive). If it does contain multiple categories, then the query matches if any one of the category filter criteria is met, i.e. it is a logical 'OR' of the contained category criteria. To match, an entry must contain at least one included category or must not contain at least one excluded category.

It is also possible to add multiple CategoryFilters to a Query. In this case, each individual CategoryFilter must be true for an entry to match, i.e. it is a logical 'AND' of all CategoryFilters.

See Also:
  `Query.addCategoryFilter(CategoryFilter)`

Constructor Summary
`Query.CategoryFilter()` Creates an empty category filter.
`Query.CategoryFilter(ICategory category)` Creates a simple category filter containing only a single `ICategory`.
`Query.CategoryFilter(java.util.List<ICategory> included, java.util.List<ICategory> excluded)` Creates a new category filter using the supplied inclusion and exclusion lists.

Method Summary
`void` `addCategory(ICategory category)` Adds a new `ICategory` to the query, indicating that entries containing the category should be considered to match.
`void` `addExcludeCategory(ICategory category)` Adds a new `ICategory` to the query, indicating that entries that do not contain the category should be considered to match.
`java.util.List<ICategory>` `getCategories()`
`java.util.List<ICategory>` `getExcludeCategories()`
`java.lang.String` `toString()` Returns a string representation for the category conditions in the CategoryFilter, in the format used by a Query URI.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Query.CategoryFilter

    public Query.CategoryFilter()

  Creates an empty category filter.

### Query.CategoryFilter

    public Query.CategoryFilter(java.util.List<ICategory> included,
                                java.util.List<ICategory> excluded)

  Creates a new category filter using the supplied inclusion and exclusion lists. A null value for either is equivalent to an empty list.

### Query.CategoryFilter

    public Query.CategoryFilter(ICategory category)

  Creates a simple category filter containing only a single `ICategory`.

  Parameters:
    `category` - an initial category to add to the filter.

Method Detail

### getCategories

    public java.util.List<ICategory> getCategories()

### getExcludeCategories

    public java.util.List<ICategory> getExcludeCategories()

### addCategory

    public void addCategory(ICategory category)

  Adds a new `ICategory` to the query, indicating that entries containing the category should be considered to match.

  Parameters:
    `category` - the category to add to query parameters.

### addExcludeCategory

    public void addExcludeCategory(ICategory category)

  Adds a new `ICategory` to the query, indicating that entries that do not contain the category should be considered to match.

  Parameters:
    `category` - the category to add to query parameters.

### toString

    public java.lang.String toString()

  Returns a string representation for the category conditions in the CategoryFilter, in the format used by a Query URI.

  Overrides:
    `toString` in class `java.lang.Object`