org.apache.stanbol.entityhub.servicesapi.query
Interface Query

All Superinterfaces:
Cloneable
All Known Subinterfaces:
EntityQuery, FieldQuery

public interface Query
extends Cloneable

Common interfaces for all supported queries. The idea is that some query types MUST BE supported by the Entityhub. However some Site and Yard implementations may support additional query types.

Author:
Rupert Westenthaler

Method Summary
 Query clone()
          Clones the query.
 Integer getLimit()
          Getter for the maximum number of results for this query.
 int getOffset()
          Getter for the offset for the first result of this query.
 String getQueryType()
          The type of the Query (e.g.
 void setLimit(Integer limit)
          Setter for the maximum number of results or null if no limit is defined.
 void setOffset(int offset)
          Setter for the offset of the query.
 

Method Detail

getQueryType

String getQueryType()
The type of the Query (e.g. "fieldQuery" or "entityQuery"). Typically the type should be defines as String constant in the java interface of the query type.

Returns:
return the name of the query (usually the the value as returned by the Class.getSimpleName() class object of the Java Interface for the query type but with a Character.toLowerCase(char) for the first character.

getLimit

Integer getLimit()
Getter for the maximum number of results for this query.

Returns:
the maximum number of results or null if no limit is defined. MUST never return a number <= 1

setLimit

void setLimit(Integer limit)
Setter for the maximum number of results or null if no limit is defined.

Parameters:
limit - the limit as positive integer or null to define that no limit is defined. Parsing a negative number results in setting the limit to null.

getOffset

int getOffset()
Getter for the offset for the first result of this query.

Returns:
the offset for this query. MUST NOT return a value < 0

setOffset

void setOffset(int offset)
Setter for the offset of the query. Setting the offset to any value < 0 MUST result in setting the offset to 0

Parameters:
offset - the offset, a positive natural number including 0. Parsing a negative number results to setting the offset to 0

clone

Query clone()
Clones the query.

Returns:
the clone


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.