org.kuali.rice.kew.api.document.search
Class DocumentSearchResults.Builder

java.lang.Object
  extended by org.kuali.rice.kew.api.document.search.DocumentSearchResults.Builder
All Implemented Interfaces:
Serializable, ModelBuilder, DocumentSearchResultsContract
Enclosing class:
DocumentSearchResults

public static final class DocumentSearchResults.Builder
extends Object
implements Serializable, ModelBuilder, DocumentSearchResultsContract

A builder which can be used to construct DocumentSearchResults instances. Enforces the constraints of the DocumentSearchResultsContract.

See Also:
Serialized Form

Method Summary
 DocumentSearchResults build()
          Returns an instance of the object being built by this builder based on the current state of the builder.
static DocumentSearchResults.Builder create(DocumentSearchCriteria.Builder criteria)
          Create a builder for the document search result and initialize it with the given document search criteria builder.
static DocumentSearchResults.Builder create(DocumentSearchResultsContract contract)
          Creates a new builder instance initialized with copies of the properties from the given contract.
 DocumentSearchCriteria.Builder getCriteria()
          Returns the criteria that was used to execute the search.
 int getNumberOfSecurityFilteredResults()
          Return the number of results that matched the criteria but are not included on this results instance because they principal executing the document search did not have permissions to view them.
 List<DocumentSearchResult.Builder> getSearchResults()
          Returns the unmodifiable list of search results.
 boolean isCriteriaModified()
          Returns true if the criteria on this search result was modified from the original criteria submitted by the executor of the document search.
 boolean isOverThreshold()
          Returns true if the results of the search returned more rows then the document search framework is allowed to return back to the caller of the api.
 void setCriteria(DocumentSearchCriteria.Builder criteria)
          Sets the criteria builder on this builder to the given value.
 void setCriteriaModified(boolean criteriaModified)
           
 void setNumberOfSecurityFilteredResults(int numberOfSecurityFilteredResults)
           
 void setOverThreshold(boolean overThreshold)
           
 void setSearchResults(List<DocumentSearchResult.Builder> searchResults)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static DocumentSearchResults.Builder create(DocumentSearchCriteria.Builder criteria)
Create a builder for the document search result and initialize it with the given document search criteria builder. Additionally initializes criteriaModified to "false", overThreshold to "false", and numberOfSecurityFilteredResults to 0.

Parameters:
criteria - the document search criteria builder with which to initialize the returned builder instance
Returns:
a builder instance initialized with the given document search criteria builder
Throws:
IllegalArgumentException - if the given document search criteria builder is null

create

public static DocumentSearchResults.Builder create(DocumentSearchResultsContract contract)
Creates a new builder instance initialized with copies of the properties from the given contract.

Parameters:
contract - the contract from which to copy properties
Returns:
a builder instance initialized with properties from the given contract
Throws:
IllegalArgumentException - if the given contract is null

build

public DocumentSearchResults build()
Description copied from interface: ModelBuilder
Returns an instance of the object being built by this builder based on the current state of the builder. It should be possible to invoke this method more than once on the same builder. It should never return null;

Specified by:
build in interface ModelBuilder
Returns:
an instance of the object being built by this builder, should never return null

getSearchResults

public List<DocumentSearchResult.Builder> getSearchResults()
Description copied from interface: DocumentSearchResultsContract
Returns the unmodifiable list of search results. Each of these result objects represents a document returned from the search.

Specified by:
getSearchResults in interface DocumentSearchResultsContract
Returns:
an unmodifiable list of search results, will never be null but may be null

getCriteria

public DocumentSearchCriteria.Builder getCriteria()
Description copied from interface: DocumentSearchResultsContract
Returns the criteria that was used to execute the search. This may not be the same criteria that was submitted to the document search api since it is possible for criteria to be modified by backend processing of the submitted criteria. See DocumentSearchResultsContract.isCriteriaModified() for more information.

Specified by:
getCriteria in interface DocumentSearchResultsContract
Returns:
the criteria used to execute this search, will never be null

isCriteriaModified

public boolean isCriteriaModified()
Description copied from interface: DocumentSearchResultsContract
Returns true if the criteria on this search result was modified from the original criteria submitted by the executor of the document search. This may happen in cases where the document search implementation modifies the given criteria. This may be possible through document search customization hooks, or may happen as part of a process of "defaulting" certain portions of the criteria.

Specified by:
isCriteriaModified in interface DocumentSearchResultsContract
Returns:
a boolean indicating whether or not the criteria was modified from it's original form prior to search execution

isOverThreshold

public boolean isOverThreshold()
Description copied from interface: DocumentSearchResultsContract
Returns true if the results of the search returned more rows then the document search framework is allowed to return back to the caller of the api. The implementation of the document search is permitted to cap the number of results returned and a result cap can also be specified on the criteria itself.

Specified by:
isOverThreshold in interface DocumentSearchResultsContract
Returns:
true if there are more results available for the requested search then can be included in the list of results

getNumberOfSecurityFilteredResults

public int getNumberOfSecurityFilteredResults()
Description copied from interface: DocumentSearchResultsContract
Return the number of results that matched the criteria but are not included on this results instance because they principal executing the document search did not have permissions to view them.

Specified by:
getNumberOfSecurityFilteredResults in interface DocumentSearchResultsContract
Returns:
the number of results that were filtered for security reasons

setSearchResults

public void setSearchResults(List<DocumentSearchResult.Builder> searchResults)

setCriteria

public void setCriteria(DocumentSearchCriteria.Builder criteria)
Sets the criteria builder on this builder to the given value.

Parameters:
criteria - the criteria builder to set, must not be null
Throws:
IllegalArgumentException - if criteria is null

setCriteriaModified

public void setCriteriaModified(boolean criteriaModified)

setOverThreshold

public void setOverThreshold(boolean overThreshold)

setNumberOfSecurityFilteredResults

public void setNumberOfSecurityFilteredResults(int numberOfSecurityFilteredResults)


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.