Class DXSearch.FindDataObjectsRequestBuilder<T extends DXDataObject>
- java.lang.Object
-
- com.dnanexus.DXSearch.FindDataObjectsRequestBuilder<T>
-
- Type Parameters:
T- data object class to be returned from the query
- Enclosing class:
- DXSearch
public static class DXSearch.FindDataObjectsRequestBuilder<T extends DXDataObject> extends Object
Builder class for formulatingfindDataObjectsqueries and executing them.Obtain an instance of this class via
DXSearch.findDataObjects().
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DXSearch.FindDataObjectsRequestBuilder<T>createdAfter(Date createdAfter)Only returns data objects that were created after the specified time.DXSearch.FindDataObjectsRequestBuilder<T>createdBefore(Date createdBefore)Only returns data objects that were created before the specified time.DXSearch.FindDataObjectsResult<T>execute()Executes the query.DXSearch.FindDataObjectsResult<T>execute(int pageSize)Executes the query with the specified page size.DXSearch.FindDataObjectsRequestBuilder<T>includeDescribeOutput()Requests the default describe data for each matching data object when the query is run.DXSearch.FindDataObjectsRequestBuilder<T>includeDescribeOutput(DXDataObject.DescribeOptions describeOptions)Requests describe data (with the specified options) for each matching data object when the query is run.DXSearch.FindDataObjectsRequestBuilder<T>inFolder(DXContainer project, String folder)Only returns objects in the specified folder of the specified project (not in subfolders).DXSearch.FindDataObjectsRequestBuilder<T>inFolderOrSubfolders(DXContainer project, String folder)Only returns objects in the specified folder of the specified project or in its subfolders.DXSearch.FindDataObjectsRequestBuilder<T>inProject(DXContainer project)Only returns objects in the specified project.DXSearch.FindDataObjectsRequestBuilder<T>modifiedAfter(Date modifiedAfter)Only returns data objects that were last modified after the specified time.DXSearch.FindDataObjectsRequestBuilder<T>modifiedBefore(Date modifiedBefore)Only returns data objects that were last modified before the specified time.DXSearch.FindDataObjectsRequestBuilder<T>nameMatchesExactly(String name)Only returns objects whose names exactly equal the specified string.DXSearch.FindDataObjectsRequestBuilder<T>nameMatchesGlob(String glob)Only returns objects whose name match the specified glob.DXSearch.FindDataObjectsRequestBuilder<T>nameMatchesRegexp(String regexp)Only returns objects whose names match the specified regexp.DXSearch.FindDataObjectsRequestBuilder<T>nameMatchesRegexp(String regexp, boolean caseInsensitive)Only returns objects whose names match the specified regexp (optionally allowing the match to be case insensitive).DXSearch.FindDataObjectsRequestBuilder<T>withArchivalState(ArchivalState archivalState)Only returns files with the specified archival state.DXSearch.FindDataObjectsRequestBuilder<DXApplet>withClassApplet()Only returns applets (filters out data objects of all other classes).DXSearch.FindDataObjectsRequestBuilder<DXFile>withClassFile()Only returns files (filters out data objects of all other classes).DXSearch.FindDataObjectsRequestBuilder<DXRecord>withClassRecord()Only returns records (filters out data objects of all other classes).DXSearch.FindDataObjectsRequestBuilder<DXWorkflow>withClassWorkflow()Only returns workflows (filters out data objects of all other classes).DXSearch.FindDataObjectsRequestBuilder<T>withIdsIn(Collection<? extends DXDataObject> dataObjects)Only returns data objects whose IDs match one of the specified data objects.DXSearch.FindDataObjectsRequestBuilder<T>withLinkTo(DXDataObject dataObject)Only returns data objects that link to the specified data object.DXSearch.FindDataObjectsRequestBuilder<T>withMinimumAccessLevel(AccessLevel level)Only returns data objects to which the requesting user has at least the specified level of permission in some project.DXSearch.FindDataObjectsRequestBuilder<T>withProperties(DXSearch.PropertiesQuery propertiesQuery)Only returns data objects matching the specified properties query.DXSearch.FindDataObjectsRequestBuilder<T>withProperty(String propertyKey)Only returns data objects where the specified property is present.DXSearch.FindDataObjectsRequestBuilder<T>withProperty(String propertyKey, Boolean propertyExists)Only returns data objects where the specified property either exists or not.DXSearch.FindDataObjectsRequestBuilder<T>withProperty(String propertyKey, String propertyValue)Only returns data objects where the specified property has the specified value.DXSearch.FindDataObjectsRequestBuilder<T>withProperty(String propertyKey, Map<String,String> mapValue)Only returns data objects where the property key is not equal to the given valueDXSearch.FindDataObjectsRequestBuilder<T>withSortBy(String field, DXSearch.Ordering ordering)Requests that the returned data objects are sorted by the specified field.DXSearch.FindDataObjectsRequestBuilder<T>withState(DataObjectState state)Only returns data objects with the specified state.DXSearch.FindDataObjectsRequestBuilder<T>withTag(String tag)Only returns data objects with the specified tag.DXSearch.FindDataObjectsRequestBuilder<T>withTags(DXSearch.TagsQuery tagsQuery)Only returns data objects matching the specified tags query.DXSearch.FindDataObjectsRequestBuilder<T>withType(String type)Only returns data objects with the specified type.DXSearch.FindDataObjectsRequestBuilder<T>withTypes(DXSearch.TypeQuery typeQuery)Only returns data objects matching the specified types query.DXSearch.FindDataObjectsRequestBuilder<T>withVisibility(DXSearch.VisibilityQuery visibilityQuery)Only returns data objects with the specified visibility (visible or hidden).
-
-
-
Method Detail
-
createdAfter
public DXSearch.FindDataObjectsRequestBuilder<T> createdAfter(Date createdAfter)
Only returns data objects that were created after the specified time.- Parameters:
createdAfter- creation date- Returns:
- the same builder object
-
createdBefore
public DXSearch.FindDataObjectsRequestBuilder<T> createdBefore(Date createdBefore)
Only returns data objects that were created before the specified time.- Parameters:
createdBefore- creation date- Returns:
- the same builder object
-
execute
public DXSearch.FindDataObjectsResult<T> execute()
Executes the query.- Returns:
- object encapsulating the result set
-
execute
public DXSearch.FindDataObjectsResult<T> execute(int pageSize)
Executes the query with the specified page size.- Parameters:
pageSize- number of results to obtain on each request- Returns:
- object encapsulating the result set
-
includeDescribeOutput
public DXSearch.FindDataObjectsRequestBuilder<T> includeDescribeOutput()
Requests the default describe data for each matching data object when the query is run. TheDXDataObject.getCachedDescribe()method can be used if, and only if, this method is called at query time.- Returns:
- the same builder object
-
includeDescribeOutput
public DXSearch.FindDataObjectsRequestBuilder<T> includeDescribeOutput(DXDataObject.DescribeOptions describeOptions)
Requests describe data (with the specified options) for each matching data object when the query is run. TheDXDataObject.getCachedDescribe()method can be used if, and only if, this method is called at query time.- Parameters:
describeOptions- options specifying which fields to be returned or a project hint- Returns:
- the same builder object
-
inFolder
public DXSearch.FindDataObjectsRequestBuilder<T> inFolder(DXContainer project, String folder)
Only returns objects in the specified folder of the specified project (not in subfolders).This method may only be called once during the construction of a query, and is mutually exclusive with
inFolderOrSubfolders(DXContainer, String)andinProject(DXContainer).- Parameters:
project- project or container to search infolder- full path to folder to search in (a String starting with"/")- Returns:
- the same builder object
-
inFolderOrSubfolders
public DXSearch.FindDataObjectsRequestBuilder<T> inFolderOrSubfolders(DXContainer project, String folder)
Only returns objects in the specified folder of the specified project or in its subfolders.This method may only be called once during the construction of a query, and is mutually exclusive with
inFolder(DXContainer, String)andinProject(DXContainer).- Parameters:
project- project or container to search infolder- full path to folder to search in (a String starting with"/")- Returns:
- the same builder object
-
inProject
public DXSearch.FindDataObjectsRequestBuilder<T> inProject(DXContainer project)
Only returns objects in the specified project.This method may only be called once during the construction of a query, and is mutually exclusive with
inFolder(DXContainer, String)andinFolderOrSubfolders(DXContainer, String).- Parameters:
project- project or container to search in- Returns:
- the same builder object
-
withSortBy
public DXSearch.FindDataObjectsRequestBuilder<T> withSortBy(String field, DXSearch.Ordering ordering)
Requests that the returned data objects are sorted by the specified field. If not specified, the default is to return data sorted by the "modified" field. It can only be used when scope is provided.- Parameters:
field- field name by which the data objects should be orderedordering- value specifying in what order the data objects should be sorted- Returns:
- the same builder object
-
modifiedAfter
public DXSearch.FindDataObjectsRequestBuilder<T> modifiedAfter(Date modifiedAfter)
Only returns data objects that were last modified after the specified time.- Parameters:
modifiedAfter- last modified date- Returns:
- the same builder object
-
modifiedBefore
public DXSearch.FindDataObjectsRequestBuilder<T> modifiedBefore(Date modifiedBefore)
Only returns data objects that were last modified before the specified time.- Parameters:
modifiedBefore- last modified date- Returns:
- the same builder object
-
nameMatchesExactly
public DXSearch.FindDataObjectsRequestBuilder<T> nameMatchesExactly(String name)
Only returns objects whose names exactly equal the specified string.This method may only be called once during the construction of a query, and is mutually exclusive with
nameMatchesGlob(String),nameMatchesRegexp(String), andnameMatchesRegexp(String, boolean).- Parameters:
name- basename of data object- Returns:
- the same builder object
-
nameMatchesGlob
public DXSearch.FindDataObjectsRequestBuilder<T> nameMatchesGlob(String glob)
Only returns objects whose name match the specified glob.This method may only be called once during the construction of a query, and is mutually exclusive with
nameMatchesExactly(String),nameMatchesRegexp(String), andnameMatchesRegexp(String, boolean).- Parameters:
glob- shell-like pattern to be matched against data object basename- Returns:
- the same builder object
-
nameMatchesRegexp
public DXSearch.FindDataObjectsRequestBuilder<T> nameMatchesRegexp(String regexp)
Only returns objects whose names match the specified regexp.This method may only be called once during the construction of a query, and is mutually exclusive with
nameMatchesExactly(String),nameMatchesGlob(String), andnameMatchesRegexp(String, boolean).- Parameters:
regexp- regexp to be matched against data object basename- Returns:
- the same builder object
-
nameMatchesRegexp
public DXSearch.FindDataObjectsRequestBuilder<T> nameMatchesRegexp(String regexp, boolean caseInsensitive)
Only returns objects whose names match the specified regexp (optionally allowing the match to be case insensitive).This method may only be called once during the construction of a query, and is mutually exclusive with
nameMatchesExactly(String),nameMatchesGlob(String), andnameMatchesRegexp(String).- Parameters:
regexp- regexp to be matched against data object basenamecaseInsensitive- if true, the regexp is matched case-insensitively- Returns:
- the same builder object
-
withArchivalState
public DXSearch.FindDataObjectsRequestBuilder<T> withArchivalState(ArchivalState archivalState)
Only returns files with the specified archival state. If not specified, the default is to return all objects regardless their archival state.Please note archival states are supported only for "file" class (use
withClassFile()). This filter requires project and folder (can be root "/") to be specified (use eitherinFolder(DXContainer, String)orinFolderOrSubfolders(DXContainer, String)).- Parameters:
archivalState- enum value specifying what files archival states can be returned- Returns:
- the same builder object
-
withClassApplet
public DXSearch.FindDataObjectsRequestBuilder<DXApplet> withClassApplet()
Only returns applets (filters out data objects of all other classes).This method may only be called once during the construction of a query, and is mutually exclusive with
withClassFile(),withClassRecord(), andwithClassWorkflow().- Returns:
- the same builder object
-
withClassFile
public DXSearch.FindDataObjectsRequestBuilder<DXFile> withClassFile()
Only returns files (filters out data objects of all other classes).This method may only be called once during the construction of a query, and is mutually exclusive with
withClassApplet(),withClassRecord(), andwithClassWorkflow().- Returns:
- the same builder object
-
withClassRecord
public DXSearch.FindDataObjectsRequestBuilder<DXRecord> withClassRecord()
Only returns records (filters out data objects of all other classes).This method may only be called once during the construction of a query, and is mutually exclusive with
withClassApplet(),withClassFile(), andwithClassWorkflow().- Returns:
- the same builder object
-
withClassWorkflow
public DXSearch.FindDataObjectsRequestBuilder<DXWorkflow> withClassWorkflow()
Only returns workflows (filters out data objects of all other classes).This method may only be called once during the construction of a query, and is mutually exclusive with
withClassApplet(),withClassFile(), andwithClassRecord().- Returns:
- the same builder object
-
withIdsIn
public DXSearch.FindDataObjectsRequestBuilder<T> withIdsIn(Collection<? extends DXDataObject> dataObjects)
Only returns data objects whose IDs match one of the specified data objects.When used in combination with
includeDescribeOutput()orincludeDescribeOutput(com.dnanexus.DXDataObject.DescribeOptions)you can use this to "bulk describe" a large number of objects. Note that hidden objects among the requested list will not be returned unless you usewithVisibility(DXSearch.VisibilityQuery)to request all objects.The number of results may exceed the number of unique data objects supplied because each result appears once for each accessible project it can be found in (you can call
inProject(DXContainer)to avoid this multiplicity).- Parameters:
dataObjects- collection of data objects- Returns:
- the same builder object
-
withLinkTo
public DXSearch.FindDataObjectsRequestBuilder<T> withLinkTo(DXDataObject dataObject)
Only returns data objects that link to the specified data object.- Parameters:
dataObject- data object that must be the target of a DNAnexus link on matching data objects- Returns:
- the same builder object
-
withMinimumAccessLevel
public DXSearch.FindDataObjectsRequestBuilder<T> withMinimumAccessLevel(AccessLevel level)
Only returns data objects to which the requesting user has at least the specified level of permission in some project.- Parameters:
level- project access level (must be greater than NONE)- Returns:
- the same data object
-
withProperties
public DXSearch.FindDataObjectsRequestBuilder<T> withProperties(DXSearch.PropertiesQuery propertiesQuery)
Only returns data objects matching the specified properties query.- Parameters:
propertiesQuery- properties query- Returns:
- the same builder object
-
withProperty
public DXSearch.FindDataObjectsRequestBuilder<T> withProperty(String propertyKey)
Only returns data objects where the specified property is present.To specify a complex query on the properties, use
withProperties(DXSearch.PropertiesQuery).- Parameters:
propertyKey- property key that must be present- Returns:
- the same builder object
-
withProperty
public DXSearch.FindDataObjectsRequestBuilder<T> withProperty(String propertyKey, String propertyValue)
Only returns data objects where the specified property has the specified value.To specify a complex query on the properties, use
withProperties(DXSearch.PropertiesQuery).- Parameters:
propertyKey- property keypropertyValue- property value- Returns:
- the same builder object
-
withProperty
public DXSearch.FindDataObjectsRequestBuilder<T> withProperty(String propertyKey, Boolean propertyExists)
Only returns data objects where the specified property either exists or not.To specify a complex query on the properties, use
withProperties(DXSearch.PropertiesQuery).- Parameters:
propertyKey- property keypropertyExists- boolean indicating whether the property is set on the data object (true) or not (false)- Returns:
- the same builder object
-
withProperty
public DXSearch.FindDataObjectsRequestBuilder<T> withProperty(String propertyKey, Map<String,String> mapValue)
Only returns data objects where the property key is not equal to the given valueTo specify a complex query on the properties, use
withProperties(DXSearch.PropertiesQuery).- Parameters:
propertyKey- property keymapValue- hash map property value; the accepted key is "$ne"; it indicates the key specified in propertyKey must not equal the string value in mapValue- Returns:
- the same builder object
-
withState
public DXSearch.FindDataObjectsRequestBuilder<T> withState(DataObjectState state)
Only returns data objects with the specified state.- Parameters:
state- data object state- Returns:
- the same builder object
-
withTag
public DXSearch.FindDataObjectsRequestBuilder<T> withTag(String tag)
Only returns data objects with the specified tag.To specify a complex query on the tags, use
withTags(DXSearch.TagsQuery).- Parameters:
tag- String containing a tag- Returns:
- the same builder object
-
withTags
public DXSearch.FindDataObjectsRequestBuilder<T> withTags(DXSearch.TagsQuery tagsQuery)
Only returns data objects matching the specified tags query.- Parameters:
tagsQuery- tags query- Returns:
- the same builder object
-
withType
public DXSearch.FindDataObjectsRequestBuilder<T> withType(String type)
Only returns data objects with the specified type.- Parameters:
type- String containing a type- Returns:
- the same builder object
-
withTypes
public DXSearch.FindDataObjectsRequestBuilder<T> withTypes(DXSearch.TypeQuery typeQuery)
Only returns data objects matching the specified types query.- Parameters:
typeQuery- types query- Returns:
- the same builder object
-
withVisibility
public DXSearch.FindDataObjectsRequestBuilder<T> withVisibility(DXSearch.VisibilityQuery visibilityQuery)
Only returns data objects with the specified visibility (visible or hidden). If not specified, the default is to return only visible objects.- Parameters:
visibilityQuery- enum value specifying what visibility/ies can be returned.- Returns:
- the same builder object
-
-