Class DocumentSearchResult.Builder

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

public static final class DocumentSearchResult.Builder extends Object implements Serializable, org.kuali.rice.core.api.mo.ModelBuilder, DocumentSearchResultContract
A builder which can be used to construct DocumentSearchResult instances. Enforces the constraints of the DocumentSearchResultContract.
See Also:
  • Method Details

    • 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

      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()
      Specified by:
      build in interface org.kuali.rice.core.api.mo.ModelBuilder
    • 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)