com.aliyun.hitsdb.client.value.request.Query.Builder
public static class Query.Builder extends ObjectQuery.Builder constructs a Query object that defines the time range and subqueries for a data query. Call build() at the end of the chain to get the Query instance.
Typical usage:
Query query = new Query.Builder(1609459200000L)
.end(1609462800000L)
.sub(subQuery)
.build();Constructors
| Constructor | Description |
|---|---|
Builder(long startTime) | Creates a builder with the specified start time. |
Builder(long startTime, long endTime) | Creates a builder with both start and end times. |
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
startTime | long | Yes | Start of the time range. |
endTime | long | No (constructor 2 only) | End of the time range. |
Constructor details
public Builder(long startTime)Creates a builder with the specified start time.
public Builder(long startTime, long endTime)Creates a builder with both start and end times.
Methods
| Return type | Method | Description |
|---|---|---|
Query | build() | Builds and returns the Query instance. |
Query.Builder | end(long endTime) | Sets the end of the time range. |
Query.Builder | sub(SubQuery... subQuerys) | Adds one or more SubQuery objects. |
Query.Builder | sub(Collection<SubQuery> subQuerys) | Adds a collection of SubQuery objects. |
Query.Builder | delete() | Specifies to delete the queried data. Currently unavailable. |
Query.Builder | delete(boolean delete) | Specifies to delete the queried data. Currently unavailable. |
Method details
build()
public Query build()Builds and returns the Query instance. Call this as the last step in the builder chain.
end(long endTime)
public Query.Builder end(long endTime)Sets the end of the time range.
sub(SubQuery... subQuerys)
public Query.Builder sub(SubQuery... subQuerys)Adds one or more SubQuery objects to the query.
sub(Collection<SubQuery> subQuerys)
public Query.Builder sub(Collection<SubQuery> subQuerys)Adds a collection of SubQuery objects to the query. Use this overload when you have subqueries stored in a List or other Collection.
delete() and delete(boolean delete)
public Query.Builder delete()
public Query.Builder delete(boolean delete)These methods specify deletion of the queried data and are currently unavailable. Do not use them.
Methods inherited from java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait