Class DefaultSdkMetric<T>
- java.lang.Object
-
- software.amazon.awssdk.utils.AttributeMap.Key<T>
-
- software.amazon.awssdk.metrics.internal.DefaultSdkMetric<T>
-
- All Implemented Interfaces:
SdkMetric<T>
public final class DefaultSdkMetric<T> extends AttributeMap.Key<T> implements SdkMetric<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class software.amazon.awssdk.utils.AttributeMap.Key
AttributeMap.Key.UnsafeValueType
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<MetricCategory>
categories()
static <T> SdkMetric<T>
create(String name, Class<T> clzz, MetricLevel level, Set<MetricCategory> categories)
Create a new metric.static <T> SdkMetric<T>
create(String name, Class<T> clzz, MetricLevel level, MetricCategory c1, MetricCategory... cn)
Create a new metric.boolean
equals(Object o)
int
hashCode()
MetricLevel
level()
String
name()
String
toString()
Class<T>
valueClass()
-
Methods inherited from class software.amazon.awssdk.utils.AttributeMap.Key
convertValue
-
-
-
-
Method Detail
-
name
public String name()
-
categories
public Set<MetricCategory> categories()
- Specified by:
categories
in interfaceSdkMetric<T>
- Returns:
- The categories of this event.
-
level
public MetricLevel level()
-
valueClass
public Class<T> valueClass()
- Specified by:
valueClass
in interfaceSdkMetric<T>
- Returns:
- The class of the value associated with this event.
-
create
public static <T> SdkMetric<T> create(String name, Class<T> clzz, MetricLevel level, MetricCategory c1, MetricCategory... cn)
Create a new metric.- Type Parameters:
T
- The type of the object containing the associated value for this metric.- Parameters:
name
- The name of this metric.clzz
- The class of the object containing the associated value for this metric.c1
- A category associated with this metric.cn
- Additional categories associated with this metric.- Returns:
- The created metric.
- Throws:
IllegalArgumentException
- If a metric of the same name has already been created.
-
create
public static <T> SdkMetric<T> create(String name, Class<T> clzz, MetricLevel level, Set<MetricCategory> categories)
Create a new metric.- Type Parameters:
T
- The type of the object containing the associated value for this metric.- Parameters:
name
- The name of this metric.clzz
- The class of the object containing the associated value for this metric.categories
- The categories associated with this metric.- Returns:
- The created metric.
- Throws:
IllegalArgumentException
- If a metric of the same name has already been created.
-
-