org.sonar.api.batch.sensor.measure.internal
Class DefaultMeasure<G extends Serializable>

java.lang.Object
  extended by org.sonar.api.batch.sensor.internal.DefaultStorable
      extended by org.sonar.api.batch.sensor.measure.internal.DefaultMeasure<G>
All Implemented Interfaces:
Measure<G>

public class DefaultMeasure<G extends Serializable>
extends DefaultStorable
implements Measure<G>


Field Summary
 
Fields inherited from class org.sonar.api.batch.sensor.internal.DefaultStorable
storage
 
Constructor Summary
DefaultMeasure()
           
DefaultMeasure(SensorStorage storage)
           
 
Method Summary
 void doSave()
           
 boolean equals(Object obj)
           
 DefaultMeasure<G> forMetric(Metric<G> metric)
          Set the metric this measure belong to.
 int hashCode()
           
 InputFile inputFile()
          The file the measure belong to.
 boolean isFromCore()
          For internal use.
 Metric<G> metric()
          The metric this measure belong to.
 DefaultMeasure<G> onFile(InputFile inputFile)
          The file the measure belongs to.
 DefaultMeasure<G> onProject()
          Tell that the measure is global to the project.
 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.Measure
save
 

Constructor Detail

DefaultMeasure

public DefaultMeasure()

DefaultMeasure

public DefaultMeasure(@Nullable
                      SensorStorage storage)
Method Detail

onFile

public DefaultMeasure<G> onFile(InputFile inputFile)
Description copied from interface: Measure
The file the measure belongs to.

Specified by:
onFile in interface Measure<G extends Serializable>

onProject

public DefaultMeasure<G> onProject()
Description copied from interface: Measure
Tell that the measure is global to the project.

Specified by:
onProject in interface Measure<G extends Serializable>

forMetric

public DefaultMeasure<G> forMetric(Metric<G> metric)
Description copied from interface: Measure
Set the metric this measure belong to.

Specified by:
forMetric in interface Measure<G extends Serializable>

withValue

public DefaultMeasure<G> withValue(G value)
Description copied from interface: Measure
Value of the measure.

Specified by:
withValue in interface Measure<G extends 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 class DefaultStorable

metric

public Metric<G> metric()
Description copied from interface: Measure
The metric this measure belong to.

Specified by:
metric in interface Measure<G extends Serializable>

inputFile

@CheckForNull
public InputFile inputFile()
Description copied from interface: Measure
The file the measure belong to.

Specified by:
inputFile in interface Measure<G extends Serializable>
Returns:
null if measure is on project

value

public G value()
Description copied from interface: Measure
Value of the measure.

Specified by:
value in interface Measure<G extends Serializable>

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2009–2015 SonarSource. All rights reserved.