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

java.lang.Object
  extended by org.kuali.rice.core.api.mo.AbstractDataTransferObject
      extended by org.kuali.rice.kew.api.document.search.DocumentSearchResult
All Implemented Interfaces:
Serializable, ModelObjectBasic, ModelObjectComplete, DocumentSearchResultContract

public final class DocumentSearchResult
extends AbstractDataTransferObject
implements DocumentSearchResultContract

An immutable data transfer object implementation of the DocumentSearchResultContract. Instances of this class should be constructed using the nested DocumentSearchResult.Builder class.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Nested Class Summary
static class DocumentSearchResult.Builder
          A builder which can be used to construct DocumentSearchResult instances.
 
Method Summary
 Document getDocument()
          Returns the document represented by this result.
 List<DocumentAttribute> getDocumentAttributeByName(String attributeName)
          Returns an unmodifiable list of all document attributes on this result which have the given name.
 List<DocumentAttribute> getDocumentAttributes()
          Returns an unmodifiable list of objects implementing the DocumentAttributeContract interface.
 DocumentAttribute getSingleDocumentAttributeByName(String attributeName)
          Returns a single document attribute from this result which has the given name.
 
Methods inherited from class org.kuali.rice.core.api.mo.AbstractDataTransferObject
afterUnmarshal, beforeUnmarshal, equals, equalsExcludeFields, getDefaultHashCodeEqualsExcludeFields, hashCode, hashCodeExcludeFields, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getDocument

public Document 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> 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

getDocumentAttributeByName

public List<DocumentAttribute> getDocumentAttributeByName(String attributeName)
Returns an unmodifiable list of all document attributes on this result which have the given name. It is legal for a result to contain more than one attribute of the same name. In these cases, this represents a document attribute which has more than one value.

Parameters:
attributeName - the attribute name of document attributes to retrieve
Returns:
an unmodifiable list of document attributes with the given name, will never be null but may be empty

getSingleDocumentAttributeByName

public DocumentAttribute getSingleDocumentAttributeByName(String attributeName)
Returns a single document attribute from this result which has the given name. If there is more than one document attribute on this result with the given name, only a single one will be returned (though it is undeterministic which one will this will be). If there are no attributes on this result with the given name then this method will return null.

Parameters:
attributeName - the attribute name of the document attribute to retrieve
Returns:
a single document attribute with the given name, or null if one does not exist


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