Class DefaultMeasure<G extends java.io.Serializable>
- java.lang.Object
-
- org.sonar.api.batch.sensor.internal.DefaultStorable
-
- org.sonar.api.batch.sensor.measure.internal.DefaultMeasure<G>
-
- All Implemented Interfaces:
Measure<G>
,NewMeasure<G>
public class DefaultMeasure<G extends java.io.Serializable> extends DefaultStorable implements Measure<G>, NewMeasure<G>
-
-
Field Summary
-
Fields inherited from class org.sonar.api.batch.sensor.internal.DefaultStorable
storage
-
-
Constructor Summary
Constructors Constructor Description DefaultMeasure()
DefaultMeasure(SensorStorage storage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doSave()
boolean
equals(java.lang.Object obj)
DefaultMeasure<G>
forMetric(Metric<G> metric)
Set the metric this measure belong to.int
hashCode()
InputComponent
inputComponent()
TheInputComponent
this measure belongs to.boolean
isFromCore()
For internal use.Metric<G>
metric()
The metric this measure belong to.DefaultMeasure<G>
on(InputComponent component)
TheInputComponent
the measure belongs to.DefaultMeasure<G>
setFromCore()
For internal use.G
value()
Value of the measure.DefaultMeasure<G>
withValue(G value)
Value of the measure.-
Methods inherited from class org.sonar.api.batch.sensor.internal.DefaultStorable
save, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.sonar.api.batch.sensor.measure.NewMeasure
save
-
-
-
-
Constructor Detail
-
DefaultMeasure
public DefaultMeasure()
-
DefaultMeasure
public DefaultMeasure(@Nullable SensorStorage storage)
-
-
Method Detail
-
on
public DefaultMeasure<G> on(InputComponent component)
Description copied from interface:NewMeasure
TheInputComponent
the measure belongs to. Mandatory.- Specified by:
on
in interfaceNewMeasure<G extends java.io.Serializable>
-
forMetric
public DefaultMeasure<G> forMetric(Metric<G> metric)
Description copied from interface:NewMeasure
Set the metric this measure belong to. To find a metric based on its key you can useMetricFinder
.- Specified by:
forMetric
in interfaceNewMeasure<G extends java.io.Serializable>
-
withValue
public DefaultMeasure<G> withValue(G value)
Description copied from interface:NewMeasure
Value of the measure.- Specified by:
withValue
in interfaceNewMeasure<G extends java.io.Serializable>
-
isFromCore
public boolean isFromCore()
For internal use.
-
setFromCore
public DefaultMeasure<G> setFromCore()
For internal use. Used by core components to bypass check that prevent a plugin to store core measures.
-
doSave
public void doSave()
- Specified by:
doSave
in classDefaultStorable
-
metric
public Metric<G> metric()
Description copied from interface:Measure
The metric this measure belong to.
-
inputComponent
public InputComponent inputComponent()
Description copied from interface:Measure
TheInputComponent
this measure belongs to.- Specified by:
inputComponent
in interfaceMeasure<G extends java.io.Serializable>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-