Class DefaultSdkMetric<T>

    • Method Detail

      • name

        public String name()
        Specified by:
        name in interface SdkMetric<T>
        Returns:
        The name of this event.
      • valueClass

        public Class<T> valueClass()
        Specified by:
        valueClass in interface SdkMetric<T>
        Returns:
        The class of the value associated with this event.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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.