org.gcube.opensearch.opensearchlibrary.query.extensions.time
Class TimeQueryBuilder

java.lang.Object
  extended by org.gcube.opensearch.opensearchlibrary.query.QueryBuilderDecorator
      extended by org.gcube.opensearch.opensearchlibrary.query.extensions.time.TimeQueryBuilder
All Implemented Interfaces:
QueryBuilder

public class TimeQueryBuilder
extends QueryBuilderDecorator


Constructor Summary
TimeQueryBuilder(QueryBuilder qb)
           
 
Method Summary
 QueryBuilder clone()
          Returns a copy of this query builder
 java.lang.String getQuery()
          Retrieves the search query corresponding to the current state of the query builder
static void main(java.lang.String[] args)
           
 TimeQueryBuilder setParameter(java.lang.String name, java.lang.String value)
          Assigns a string value to a parameter of the query builder
 TimeQueryBuilder setParameters(java.util.List<java.lang.String> names, java.util.List<java.lang.Object> values)
          Assigns to each parameter contained in the list of the first argument the respective value contained in the list of the secord argument
 QueryBuilder setParameters(QueryElement queryEl)
          Sets all parameters of the query builder that are also contained in the QueryElement provided with the values contained in the QueryElement
 
Methods inherited from class org.gcube.opensearch.opensearchlibrary.query.QueryBuilderDecorator
getOptionalParameters, getParameterValue, getRawTemplate, getRequiredParameters, getStartIndexDef, getStartPageDef, getUnsetParameters, hasParameter, isParameterSet, isQueryComplete, setParameter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeQueryBuilder

public TimeQueryBuilder(QueryBuilder qb)
Method Detail

clone

public QueryBuilder clone()
Description copied from interface: QueryBuilder
Returns a copy of this query builder

Specified by:
clone in interface QueryBuilder
Overrides:
clone in class QueryBuilderDecorator
Returns:
A new query builder whose state is the same as this instance

setParameter

public TimeQueryBuilder setParameter(java.lang.String name,
                                     java.lang.String value)
                              throws NonExistentParameterException,
                                     java.lang.Exception
Assigns a string value to a parameter of the query builder

Specified by:
setParameter in interface QueryBuilder
Overrides:
setParameter in class QueryBuilderDecorator
Parameters:
name - The qualified name of the parameter
value - The value to be assigned to the parameter
Returns:
The query builder with the parameter value assigned to the parameter
Throws:
NonExistentParameterException - If the parameter is not contained in the parameter set of the query builder
java.lang.Exception - In case of other error
See Also:
QueryBuilder.setParameter(String, String)

setParameters

public TimeQueryBuilder setParameters(java.util.List<java.lang.String> names,
                                      java.util.List<java.lang.Object> values)
                               throws NonExistentParameterException,
                                      java.lang.Exception
Assigns to each parameter contained in the list of the first argument the respective value contained in the list of the secord argument

Specified by:
setParameters in interface QueryBuilder
Overrides:
setParameters in class QueryBuilderDecorator
Parameters:
names - A list of parameter qualified names
values - A list of parameter values to be assigned to the respective parameter
Returns:
The query builder with the values assigned to the parameters
Throws:
NonExistentParameterException - If a parameter of the list is not contained in the parameter of the query builder
java.lang.Exception - In case of other error
See Also:
QueryBuilder.setParameters(List, List)

getQuery

public java.lang.String getQuery()
                          throws IncompleteQueryException,
                                 MalformedQueryException,
                                 java.lang.Exception
Retrieves the search query corresponding to the current state of the query builder

Specified by:
getQuery in interface QueryBuilder
Overrides:
getQuery in class QueryBuilderDecorator
Returns:
The search query
Throws:
IncompleteQueryException - If the query is not complete, i.e. there still exist unset required parameters
MalformedQueryException - If the query is malformed, e.g. if a parameter value is not of the correct form
java.lang.Exception - In case of other error
See Also:
QueryBuilder.getQuery()

setParameters

public QueryBuilder setParameters(QueryElement queryEl)
                           throws NonExistentParameterException,
                                  java.lang.Exception
Sets all parameters of the query builder that are also contained in the QueryElement provided with the values contained in the QueryElement

Specified by:
setParameters in interface QueryBuilder
Overrides:
setParameters in class QueryBuilderDecorator
Parameters:
queryEl - The query element which will be used to assign values to the parameters of the query builder
Returns:
The query builder with the QueryElement's values assigned
Throws:
java.lang.Exception - In case of error
NonExistentParameterException
See Also:
QueryBuilder.setParameters(QueryElement)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception