public class TimeMachineQuery extends Object
The query is constructed by setting filters on metrics and on dates
It is to be noted that all filters will be applied regardless of their coherence
Constructor and Description |
---|
TimeMachineQuery(Resource resource)
Create a TimeMachine query for a given resource
|
Modifier and Type | Method and Description |
---|---|
Date |
getFrom() |
List<String> |
getMetricKeys() |
List<Metric> |
getMetrics() |
Resource |
getResource() |
Date |
getTo() |
boolean |
isFromCurrentAnalysis() |
boolean |
isOnlyLastAnalysis() |
boolean |
isToCurrentAnalysis() |
TimeMachineQuery |
setFrom(Date from)
Sets the from date to be used in the query
|
TimeMachineQuery |
setFromCurrentAnalysis(boolean b) |
TimeMachineQuery |
setMetricKeys(List<String> metricKeys) |
TimeMachineQuery |
setMetricKeys(String... metricKeys) |
TimeMachineQuery |
setMetrics(List<Metric> metrics)
Sets the metrics to return
|
TimeMachineQuery |
setMetrics(Metric... metrics)
Sets the metrics to return
|
TimeMachineQuery |
setOnlyLastAnalysis(boolean onlyLastAnalysis) |
TimeMachineQuery |
setResource(Resource resource)
Sets the resource of the query
|
TimeMachineQuery |
setTo(Date to)
Sets the to date to be used in the query
|
TimeMachineQuery |
setToCurrentAnalysis(boolean b) |
String |
toString() |
TimeMachineQuery |
unsetMetrics()
Unsets the metrics
|
public TimeMachineQuery(Resource resource)
Create a TimeMachine query for a given resource
Apart from the resource the query is empty, i.e. will return all data for the resourceresource
- the resourcepublic Resource getResource()
public TimeMachineQuery setResource(Resource resource)
resource
- the resourcepublic List<Metric> getMetrics()
public TimeMachineQuery setMetrics(List<Metric> metrics)
metrics
- the list of metricspublic TimeMachineQuery setMetricKeys(String... metricKeys)
public List<String> getMetricKeys()
public TimeMachineQuery setMetricKeys(List<String> metricKeys)
public TimeMachineQuery setMetrics(Metric... metrics)
metrics
- the list of metricspublic TimeMachineQuery unsetMetrics()
public TimeMachineQuery setFrom(Date from)
from
- the from datepublic TimeMachineQuery setFromCurrentAnalysis(boolean b)
b
- whether to use the latest analysis as a from datepublic TimeMachineQuery setToCurrentAnalysis(boolean b)
b
- whether to use the latest analysis as a to datepublic boolean isFromCurrentAnalysis()
public boolean isToCurrentAnalysis()
public TimeMachineQuery setTo(Date to)
to
- the to datepublic boolean isOnlyLastAnalysis()
public TimeMachineQuery setOnlyLastAnalysis(boolean onlyLastAnalysis)
onlyLastAnalysis
- whether to only return the latest analysisCopyright © 2009-2013 SonarSource. All Rights Reserved.