Package org.intermine.api.bag
Class BagQueryConfig
- java.lang.Object
-
- org.intermine.api.bag.BagQueryConfig
-
public class BagQueryConfig extends java.lang.Object
Configuration for BagQuery objects.- Author:
- Kim Rutherford
-
-
Constructor Summary
Constructors Constructor Description BagQueryConfig(java.util.Map<java.lang.String,java.util.List<BagQuery>> bagQueries, java.util.Map<java.lang.String,java.util.List<BagQuery>> preDefaultBagQueries, java.util.Map<java.lang.String,java.util.Set<AdditionalConverter>> additionalConverters)
Create a new BagQueryConfig object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<AdditionalConverter>
getAdditionalConverters(java.lang.String type)
Return a Map from a converter Class name (such as org.intermine.bio.web.logic.OrthologueConverter) to set of additional converters.java.util.List<BagQuery>
getBagQueries(java.lang.String type)
Return a list of BagQuerys to run for a given typejava.lang.String
getConnectField()
Return the connecting field.java.lang.String
getConstrainField()
Return the constrain field.java.lang.String
getExtraConstraintClassName()
Return the class name that was passed to the constructor.boolean
getMatchOnFirst()
If flag is true, bagqueryrunner queries for identifier until match is found, returning only that first matching record.java.util.List<BagQuery>
getPreDefaultBagQueries(java.lang.String type)
Return a List of BagQuerys for the given type that should be run before the default queryvoid
setConnectField(java.lang.String connectField)
Set the connecting field for adding an extra constraint to bag queries.void
setConstrainField(java.lang.String constrainField)
Set the field to constrain when making an extra constraint.void
setExtraConstraintClassName(java.lang.String extraConstraintClassName)
Set the class name of extra constraint to use in BagQuery objects using this config object.void
setMatchOnFirst(boolean matchOnFirst)
If flag is true, bagqueryrunner queries for identifier until match is found, returning only that first matching record.
-
-
-
Constructor Detail
-
BagQueryConfig
public BagQueryConfig(java.util.Map<java.lang.String,java.util.List<BagQuery>> bagQueries, java.util.Map<java.lang.String,java.util.List<BagQuery>> preDefaultBagQueries, java.util.Map<java.lang.String,java.util.Set<AdditionalConverter>> additionalConverters)
Create a new BagQueryConfig object.- Parameters:
bagQueries
- a Map from class name to bag querypreDefaultBagQueries
- a separate map of queries to run before the defaultadditionalConverters
- extra converters configured - see getAdditionalConverters
-
-
Method Detail
-
getExtraConstraintClassName
public java.lang.String getExtraConstraintClassName()
Return the class name that was passed to the constructor. This (and connectField and constrainField) is used to configure the addition of an extra constraint to the bag queries. (eg. constraining the Organism).- Returns:
- the extra class name
-
setExtraConstraintClassName
public void setExtraConstraintClassName(java.lang.String extraConstraintClassName)
Set the class name of extra constraint to use in BagQuery objects using this config object.- Parameters:
extraConstraintClassName
- the class name
-
getConnectField
public java.lang.String getConnectField()
Return the connecting field.- Returns:
- the connecting field
-
setConnectField
public void setConnectField(java.lang.String connectField)
Set the connecting field for adding an extra constraint to bag queries.- Parameters:
connectField
- the field name
-
getConstrainField
public java.lang.String getConstrainField()
Return the constrain field.- Returns:
- the constrain field
-
setConstrainField
public void setConstrainField(java.lang.String constrainField)
Set the field to constrain when making an extra constraint.- Parameters:
constrainField
- the constraint field
-
getBagQueries
public java.util.List<BagQuery> getBagQueries(java.lang.String type)
Return a list of BagQuerys to run for a given type- Parameters:
type
- the type to fetch queries for- Returns:
- the BagQuerys Map
-
getPreDefaultBagQueries
public java.util.List<BagQuery> getPreDefaultBagQueries(java.lang.String type)
Return a List of BagQuerys for the given type that should be run before the default query- Parameters:
type
- the type to fetch queries for- Returns:
- the BagQuerys Map
-
getAdditionalConverters
public java.util.Set<AdditionalConverter> getAdditionalConverters(java.lang.String type)
Return a Map from a converter Class name (such as org.intermine.bio.web.logic.OrthologueConverter) to set of additional converters. Used on the list analysis page to convert to different type, eg. orthologues- Parameters:
type
- get converters for this type or a subtype of it- Returns:
- the additionalConverters
-
setMatchOnFirst
public void setMatchOnFirst(boolean matchOnFirst)
If flag is true, bagqueryrunner queries for identifier until match is found, returning only that first matching record. If flag is false, bagqueryrunner queries for identifier using ALL queries, returning ALL matches.- Parameters:
matchOnFirst
- the flag to set
-
getMatchOnFirst
public boolean getMatchOnFirst()
If flag is true, bagqueryrunner queries for identifier until match is found, returning only that first matching record. If flag is false, bagqueryrunner queries for identifier using ALL queries, returning ALL matches.- Returns:
- the matchOnFirst
-
-