|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.api.batch.TimeMachineQuery
public class TimeMachineQuery
A class to query TimeMachine on a given resource
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 Summary | |
---|---|
TimeMachineQuery(Resource resource)
Create a TimeMachine query for a given resource |
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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 resource
resource
- the resourceMethod Detail |
---|
public Resource getResource()
public TimeMachineQuery setResource(Resource resource)
resource
- the resource
public List<Metric> getMetrics()
public TimeMachineQuery setMetrics(List<Metric> metrics)
metrics
- the list of metrics
public TimeMachineQuery setMetricKeys(String... metricKeys)
public List<String> getMetricKeys()
public TimeMachineQuery setMetricKeys(List<String> metricKeys)
public TimeMachineQuery setMetrics(Metric... metrics)
metrics
- the list of metrics
public TimeMachineQuery unsetMetrics()
public Date getFrom()
public TimeMachineQuery setFrom(Date from)
from
- the from date
public TimeMachineQuery setFromCurrentAnalysis(boolean b)
b
- whether to use the latest analysis as a from date
public TimeMachineQuery setToCurrentAnalysis(boolean b)
b
- whether to use the latest analysis as a to date
public boolean isFromCurrentAnalysis()
public boolean isToCurrentAnalysis()
public Date getTo()
public TimeMachineQuery setTo(Date to)
to
- the to date
public boolean isOnlyLastAnalysis()
public TimeMachineQuery setOnlyLastAnalysis(boolean onlyLastAnalysis)
onlyLastAnalysis
- whether to only return the latest analysis
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |