public class Result extends Object
Constructor and Description |
---|
Result(Map<DimensionColumn,DimensionRow> dimensionRows,
Map<MetricColumn,Object> metricValues,
org.joda.time.DateTime timeStamp)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
DimensionRow |
getDimensionRow(DimensionColumn dimensionColumn)
Fetch a DimensionRow from dimensionValues based on the column provided.
|
Map<DimensionColumn,DimensionRow> |
getDimensionRows()
The dimensions in the result row expressed as an unmodifiable map keyed by columns.
|
Object |
getMetricValue(MetricColumn column)
Fetches the metric value associated with the specified metric column.
|
boolean |
getMetricValueAsBoolean(MetricColumn metricColumn)
Fetch the value of the specified metric as a boolean.
|
com.fasterxml.jackson.databind.JsonNode |
getMetricValueAsJsonNode(MetricColumn metricColumn)
Fetch the value of the specified metric as a JsonNode.
|
BigDecimal |
getMetricValueAsNumber(MetricColumn metricColumn)
Fetch the value of the specified numeric metric.
|
String |
getMetricValueAsString(MetricColumn metricColumn)
Fetch the String representation of the value of the specified metric.
|
Map<MetricColumn,Object> |
getMetricValues()
The metrics in the result row expressed as an unmodifiable map keyed by columns.
|
org.joda.time.DateTime |
getTimeStamp()
The timestamp representing the start moment of the aggregated record.
|
int |
hashCode() |
String |
toString() |
Result |
withMetricValue(MetricColumn metricColumn,
Object value)
Copy the result, adding or replacing the value of a metric
|
public Result(Map<DimensionColumn,DimensionRow> dimensionRows, Map<MetricColumn,Object> metricValues, org.joda.time.DateTime timeStamp)
dimensionRows
- The dimensions in the result expressed as a map keyed by columnsmetricValues
- The metrics in the result expressed as a map keyed by columnstimeStamp
- The timestamp of the resultpublic Result withMetricValue(MetricColumn metricColumn, Object value)
Don't add a without column method because removing columns is far less safe.
metricColumn
- The metric columnvalue
- The new value for that columnpublic Map<DimensionColumn,DimensionRow> getDimensionRows()
public Map<MetricColumn,Object> getMetricValues()
public org.joda.time.DateTime getTimeStamp()
public DimensionRow getDimensionRow(DimensionColumn dimensionColumn)
dimensionColumn
- The column whose associated value is desiredpublic Object getMetricValue(MetricColumn column)
This method should only be used when the caller does not care about the type of the value returned. If the
type is important, either getMetricValueAsNumber(MetricColumn)
,
getMetricValueAsString(MetricColumn)
, getMetricValueAsBoolean(MetricColumn)
or
getMetricValueAsJsonNode(MetricColumn)
should be used, depending on the desired type.
column
- The metric column whose value is desiredpublic BigDecimal getMetricValueAsNumber(MetricColumn metricColumn)
metricColumn
- The metric column whose value is desiredClassCastException
- if the value keyed to metricColumn is not a BigDecimalpublic String getMetricValueAsString(MetricColumn metricColumn)
metricColumn
- The metric column whose value is desiredpublic boolean getMetricValueAsBoolean(MetricColumn metricColumn)
metricColumn
- The metric column whose value is desiredClassCastException
- if the value keyed to metricColumn is not a booleanpublic com.fasterxml.jackson.databind.JsonNode getMetricValueAsJsonNode(MetricColumn metricColumn)
metricColumn
- The metric column whose value is desiredClassCastException
- if the value keyed to metricColumn is not a JsonNodeCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.