Enum Metric
- java.lang.Object
-
- java.lang.Enum<Metric>
-
- com.parasoft.findings.jenkins.coverage.model.Metric
-
- All Implemented Interfaces:
Serializable
,Comparable<Metric>
public enum Metric extends Enum<Metric>
A coverage metric to identify the coverage result type. Note the enum order since the ordinal is used to sort the values for display purposes.- Author:
- Ullrich Hafner
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Metric.MetricTendency
Metric tendency: some metrics are getting better when the value is getting larger, some other metrics are getting better when the value is getting smaller.
-
Enum Constant Summary
Enum Constants Enum Constant Description BRANCH
CLASS
COMPLEXITY
COMPLEXITY_DENSITY
COMPLEXITY_MAXIMUM
CONTAINER
Nodes that can have children.FILE
INSTRUCTION
LINE
Coverage values without children.LOC
METHOD
MODULE
MUTATION
Additional metrics without children.PACKAGE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Metric
fromTag(String tag)
Returns the metric that belongs to the specified tag.static NavigableSet<Metric>
getCoverageMetrics()
Metric.MetricTendency
getTendency()
Optional<Value>
getValueFor(Node node)
Returns the aggregated value of this metric for the specified tree of nodes.boolean
isContainer()
Returns if a given metric is a node metric.String
toTagName()
Returns the name of the metric as a tag, containing only lowercase characters and dashes.static Metric
valueOf(String name)
Returns the enum constant of this type with the specified name.static Metric[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CONTAINER
public static final Metric CONTAINER
Nodes that can have children.
-
MODULE
public static final Metric MODULE
-
PACKAGE
public static final Metric PACKAGE
-
FILE
public static final Metric FILE
-
CLASS
public static final Metric CLASS
-
METHOD
public static final Metric METHOD
-
LINE
public static final Metric LINE
Coverage values without children.
-
BRANCH
public static final Metric BRANCH
-
INSTRUCTION
public static final Metric INSTRUCTION
-
MUTATION
public static final Metric MUTATION
Additional metrics without children.
-
COMPLEXITY
public static final Metric COMPLEXITY
-
COMPLEXITY_MAXIMUM
public static final Metric COMPLEXITY_MAXIMUM
-
COMPLEXITY_DENSITY
public static final Metric COMPLEXITY_DENSITY
-
LOC
public static final Metric LOC
-
-
Method Detail
-
values
public static Metric[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Metric c : Metric.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Metric valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
fromTag
public static Metric fromTag(String tag)
Returns the metric that belongs to the specified tag.- Parameters:
tag
- the tag- Returns:
- the metric
- See Also:
toTagName()
-
getTendency
public Metric.MetricTendency getTendency()
-
isContainer
public boolean isContainer()
Returns if a given metric is a node metric.- Returns:
- if the metric is a node metric
-
toTagName
public String toTagName()
Returns the name of the metric as a tag, containing only lowercase characters and dashes.- Returns:
- the metric tag name
-
getValueFor
public Optional<Value> getValueFor(Node node)
Returns the aggregated value of this metric for the specified tree of nodes.- Parameters:
node
- the root of the tree- Returns:
- the aggregated value
-
getCoverageMetrics
public static NavigableSet<Metric> getCoverageMetrics()
-
-