public abstract class MetricResult extends Object
Class containing metric results.
Constructor and Description |
---|
MetricResult() |
Modifier and Type | Method and Description |
---|---|
static MetricResult |
empty()
Create an empty metric result.
|
static MetricResult |
fromMap(Map<String,?> values)
Create an empty metric result.
|
static MetricResult |
fromNullable(MetricResult result)
Convert a null result to an empty result.
|
abstract Map<String,Object> |
getValues()
Get the column values for this metric result.
|
static MetricResult |
singleton(String name,
Object value)
Create a singleton map result.
|
MetricResult |
withPrefix(String pfx)
Add a prefix to this metric result’s column names.
|
MetricResult |
withSuffix(String sfx)
Add a suffix to this metric result’s column names.
|
@Nonnull public abstract Map<String,Object> getValues()
Get the column values for this metric result.
@Nonnull public MetricResult withSuffix(String sfx)
Add a suffix to this metric result’s column names. The resulting keys are of the form “key.sfx”.
sfx
- The suffix to add, or null
for no change.@Nonnull public MetricResult withPrefix(String pfx)
Add a prefix to this metric result’s column names. The resulting keys are of the form “pfx.key”.
pfx
- The prefix to add, or null
for no change.@Nonnull public static MetricResult empty()
Create an empty metric result.
@Nonnull public static MetricResult fromNullable(@Nullable MetricResult result)
Convert a null result to an empty result.
result
- The result.empty()
if it is null.@Nonnull public static MetricResult fromMap(Map<String,?> values)
Create an empty metric result.
@Nonnull public static MetricResult singleton(String name, Object value)
Create a singleton map result.
name
- The column name.value
- The column value.