public final class DimensionKey extends Object
A metric advisor data feed schema DataFeedSchema
defines dimension
names and metric for a data source, For example, a SQL data source for a
wholesale company can have "product_category" and "city" as dimension names
and "revenue" as a metric.
A combination of value for all dimension names identifies a metric time-series.
A DimensionKey
can hold such a combination, for example,
[ product_category=men-shoes, city=redmond ] identifies one specific
time-series.
A DimensionKey
can also have partial dimensions, for example,
[ city=redmond ] identifying a group of time-series having value for "city"
dimension as "redmond".
Two DimensionKey
with same dimension name-value pairs identifies
the same time-series or time-series group, this means DimensionKey.equals(Object)
return true
.
Constructor and Description |
---|
DimensionKey()
Creates a new instance of DimensionKey.
|
DimensionKey(Map<String,String> dimensionNameValue)
Creates a new instance of DimensionKey that is initialized with
the provided map of dimension name-value pairs.
|
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
asMap()
Gets the dimension name-value pairs in the key as a map.
|
boolean |
equals(Object o) |
String |
get(String dimensionName)
Gets dimension value for the given
dimensionName . |
int |
hashCode() |
DimensionKey |
put(String dimensionName,
String dimensionValue)
Adds a dimension name-value to the key.
|
DimensionKey |
remove(String dimensionName)
Removes a dimension name-value from the key.
|
public DimensionKey put(String dimensionName, String dimensionValue)
dimensionName
- The dimension name.dimensionValue
- The dimension value.public String get(String dimensionName)
dimensionName
.dimensionName
- The dimension name.null
otherwise.public DimensionKey remove(String dimensionName)
dimensionName
- The name of the dimension to remove.public Map<String,String> asMap()
Copyright © 2021 Microsoft Corporation. All rights reserved.