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

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

public static final class DocumentSearchResult.Builder
extends Object
implements Serializable, ModelBuilder, DocumentSearchResultContract

A builder which can be used to construct DocumentSearchResult instances. Enforces the constraints of the DocumentSearchResultContract.

See Also:
Serialized Form

Method Summary
 DocumentSearchResult build()
          Returns an instance of the object being built by this builder based on the current state of the builder.
static DocumentSearchResult.Builder create(Document.Builder document)
          Create a builder for the document search result and initialize it with the given document builder.
static DocumentSearchResult.Builder create(DocumentSearchResultContract contract)
          Creates a new builder instance initialized with copies of the properties from the given contract.
 Document.Builder getDocument()
          Returns the document represented by this result.
 List<DocumentAttribute.AbstractBuilder<?>> getDocumentAttributes()
          Returns an unmodifiable list of objects implementing the DocumentAttributeContract interface.
 void setDocument(Document.Builder document)
           
 void setDocumentAttributes(List<DocumentAttribute.AbstractBuilder<?>> documentAttributes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static DocumentSearchResult.Builder create(Document.Builder document)
Create a builder for the document search result and initialize it with the given document builder. Additionally initializes the list of document attribute builders on the new instance to an empty list.

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

create

public static DocumentSearchResult.Builder create(DocumentSearchResultContract 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 DocumentSearchResult 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

getDocument

public Document.Builder getDocument()
Description copied from interface: DocumentSearchResultContract
Returns the document represented by this result. This should include all information available on the DocumentContract with the exception of document variables. Even if a document has variables defined they will not be included on the document returned from this method.

Specified by:
getDocument in interface DocumentSearchResultContract
Returns:
the document represented by this result, this will never be null

getDocumentAttributes

public List<DocumentAttribute.AbstractBuilder<?>> getDocumentAttributes()
Description copied from interface: DocumentSearchResultContract
Returns an unmodifiable list of objects implementing the DocumentAttributeContract interface. These define the various document attributes that have been indexed for the document represented by this result.

Specified by:
getDocumentAttributes in interface DocumentSearchResultContract
Returns:
an unmodifiable list containing the document attribute values associated with the document represented by this result, this will never be null but may be empty

setDocument

public void setDocument(Document.Builder document)

setDocumentAttributes

public void setDocumentAttributes(List<DocumentAttribute.AbstractBuilder<?>> documentAttributes)


Copyright © 2005-2015 The Kuali Foundation. All Rights Reserved.