com.atlassian.confluence.search.contentnames
Class ResultTemplate

java.lang.Object
  extended by com.atlassian.confluence.search.contentnames.ResultTemplate

public class ResultTemplate
extends Object

Class that allows clients to specify what categories of results to get back from any content name search. A default configuration is available through DEFAULT. To produce a custom configuration, use addCategory(Category, int) .


Field Summary
static ResultTemplate DEFAULT
          A default category configuration.
 
Constructor Summary
ResultTemplate()
           
 
Method Summary
 void addCategory(Category category, int maxResultCount)
          Add a category.
 boolean equals(Object o)
           
 Set<Category> getCategories()
          Returns the names of all categories defined in this configuration.
 int getMaximumResults()
           
 int getMaxResultCount(Category category)
          The maximum number of results for this category.
 int getNumberOfCategories()
          Returns the number of categories defined in this configuration.
 boolean hasCategory(Category category)
          Returns true if the specified category is defined, false otherwise.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final ResultTemplate DEFAULT
A default category configuration.

Constructor Detail

ResultTemplate

public ResultTemplate()
Method Detail

addCategory

public void addCategory(Category category,
                        int maxResultCount)
Add a category.

Parameters:
category - name of category
maxResultCount - the maximum number of results for the specified category

hasCategory

public boolean hasCategory(Category category)
Returns true if the specified category is defined, false otherwise.

Parameters:
category - name of category
Returns:
true if the specified category is defined, false otherwise.

getMaxResultCount

public int getMaxResultCount(Category category)
The maximum number of results for this category. If the specified category is not defined, then 0 is returned.

Parameters:
category - name of category
Returns:
the maximum number of results for the specified category.

getNumberOfCategories

public int getNumberOfCategories()
Returns the number of categories defined in this configuration.

Returns:
the number of categories defined in this configuration.

getCategories

public Set<Category> getCategories()
Returns the names of all categories defined in this configuration.

Returns:
the names of all categories defined in this configuration.

getMaximumResults

public int getMaximumResults()
Returns:
based on the categories and numbers of results specified for each, return the maximum number of results this template specifies

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2003–2015 Atlassian. All rights reserved.