T
- public class Query<T>
extends java.lang.Object
implements java.lang.Iterable<T>
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_COMPLEX_TYPE_OR_PROPERTY
Type of query: complex type or property.
|
static int |
TYPE_COMPLEX_TYPE_PROPERTY
Type of query: property.
|
static int |
TYPE_COMPLEX_TYPE_PROPERTY5
Type of query: property bis??
|
static int |
TYPE_ENTITY
Type of query: entity.
|
static int |
TYPE_ENTITY_SET
Type of query: entity set.
|
static int |
TYPE_LINKS
Type of query: links.
|
static int |
TYPE_PROPERTY_VALUE
Type of query: property value.
|
static int |
TYPE_UNKNOWN
Type of query: unknown.
|
Constructor and Description |
---|
Query(Service service,
java.lang.String subpath,
java.lang.Class<T> entityClass)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Query<T> |
addParameter(java.lang.String name,
java.lang.String value)
Creates a new Query
|
Query<T> |
addParameters(Series<Parameter> params)
Creates a new Query
|
protected java.lang.String |
createTargetUri()
Returns the complete target URI reference for this query.
|
void |
execute()
Executes the query.
|
Query<T> |
expand(java.lang.String path)
Creates a new Query
|
Query<T> |
filter(java.lang.String predicate)
Creates a new Query
|
int |
getCount()
Returns the total number of elements in the entity set, or -1 if it is
available.
|
Reference |
getNextPage()
Return the reference to the next page (used in server-paging mode).
|
Service |
getService()
Returns the parent client service.
|
java.lang.String |
getSubpath()
Returns the path of the targeted entity relatively to the data service
URI.
|
Query<T> |
inlineCount(boolean inlineCount)
Creates a new Query
|
java.util.Iterator<T> |
iterator()
Returns an iterator over a set of elements of type T.
|
Query<T> |
orderBy(java.lang.String criteria)
Creates a new Query
|
Query<T> |
select(java.lang.String select)
Creates a new Query
|
void |
setNextPage(Reference nextPage)
Sets the reference to the next page (used in server-paging mode).
|
void |
setQuery(java.lang.String query)
Sets the query string of the request.
|
Query<T> |
skip(int rowsCount)
Creates a new Query
|
Query<T> |
skipToken(java.lang.String token)
Creates a new Query
|
Query<T> |
top(int rowsCount)
Creates a new Query
|
public static final int TYPE_COMPLEX_TYPE_OR_PROPERTY
public static final int TYPE_COMPLEX_TYPE_PROPERTY
public static final int TYPE_COMPLEX_TYPE_PROPERTY5
public static final int TYPE_ENTITY
public static final int TYPE_ENTITY_SET
public static final int TYPE_LINKS
public static final int TYPE_PROPERTY_VALUE
public static final int TYPE_UNKNOWN
public Query<T> addParameter(java.lang.String name, java.lang.String value)
name
- The string value that contains the name of the query string
option to add.value
- The value of the query string option.public Query<T> addParameters(Series<Parameter> params)
params
- the set of name/value pairs to add to the query stringprotected java.lang.String createTargetUri()
public void execute() throws java.lang.Exception
java.lang.Exception
public Query<T> expand(java.lang.String path)
path
- A string value that contains the requesting URI.public Query<T> filter(java.lang.String predicate)
predicate
- A string value that contains the predicate used to filter the
data.public int getCount()
java.lang.Exception
public Reference getNextPage()
public Service getService()
public java.lang.String getSubpath()
public Query<T> inlineCount(boolean inlineCount)
inlineCount
- True if the total number of entities in the entity set must be
returned.public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
public Query<T> orderBy(java.lang.String criteria)
criteria
- A string value that contains the criteria used to order the
results.public Query<T> select(java.lang.String select)
select
- A string value that contains the requesting URI.public void setNextPage(Reference nextPage)
nextPage
- The reference to the next page.public void setQuery(java.lang.String query)
query
- The query string of the request.public Query<T> skip(int rowsCount)
rowsCount
- A number of rows to skip.public Query<T> skipToken(java.lang.String token)
token
- A string value that contains the requesting URI.Copyright © 2005-2020 Restlet.