All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.ai.metricsadvisor.implementation.util.MetricEnrichedSeriesDataHelper Maven / Gradle / Ivy

The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.ai.metricsadvisor.implementation.util;

import com.azure.ai.metricsadvisor.models.DimensionKey;
import com.azure.ai.metricsadvisor.models.MetricEnrichedSeriesData;

import java.time.OffsetDateTime;
import java.util.List;

/**
 * The helper class to set the non-public properties of an {@link MetricEnrichedSeriesData} instance.
 */
public final class MetricEnrichedSeriesDataHelper {
    private static MetricEnrichedSeriesDataAccessor accessor;

    private MetricEnrichedSeriesDataHelper() {
    }

    /**
     * Type defining the methods to set the non-public properties of an {@link MetricEnrichedSeriesData} instance.
     */
    public interface MetricEnrichedSeriesDataAccessor {
        void setSeriesKey(MetricEnrichedSeriesData seriesData, DimensionKey seriesKey);

        void setTimestamps(MetricEnrichedSeriesData seriesData, List timestamps);

        void setMetricValues(MetricEnrichedSeriesData seriesData, List metricValues);

        void setIsAnomalyList(MetricEnrichedSeriesData seriesData, List isAnomaly);

        void setPeriods(MetricEnrichedSeriesData seriesData, List periods);

        void setExpectedMetricValues(MetricEnrichedSeriesData seriesData, List expectedMetricValues);

        void setLowerBoundaryValues(MetricEnrichedSeriesData seriesData, List lowerBoundaryValues);

        void setUpperBoundaryValues(MetricEnrichedSeriesData seriesData, List upperBoundaryValues);
    }

    /**
     * The method called from {@link MetricEnrichedSeriesData} to set it's accessor.
     *
     * @param seriesDataAccessor The accessor.
     */
    public static void setAccessor(final MetricEnrichedSeriesDataAccessor seriesDataAccessor) {
        accessor = seriesDataAccessor;
    }

    static void setSeriesKey(MetricEnrichedSeriesData seriesData, DimensionKey seriesKey) {
        accessor.setSeriesKey(seriesData, seriesKey);
    }

    static void setTimestamps(MetricEnrichedSeriesData seriesData, List timestamps) {
        accessor.setTimestamps(seriesData, timestamps);
    }

    static void setMetricValues(MetricEnrichedSeriesData seriesData, List metricValues) {
        accessor.setMetricValues(seriesData, metricValues);
    }

    static void setIsAnomalyList(MetricEnrichedSeriesData seriesData, List isAnomaly) {
        accessor.setIsAnomalyList(seriesData, isAnomaly);
    }

    static void setPeriods(MetricEnrichedSeriesData seriesData, List periods) {
        accessor.setPeriods(seriesData, periods);
    }

    static void setExpectedMetricValues(MetricEnrichedSeriesData seriesData, List expectedMetricValues) {
        accessor.setExpectedMetricValues(seriesData, expectedMetricValues);
    }

    static void setLowerBoundaryValues(MetricEnrichedSeriesData seriesData, List lowerBoundaryValues) {
        accessor.setLowerBoundaryValues(seriesData, lowerBoundaryValues);
    }

    static void setUpperBoundaryValues(MetricEnrichedSeriesData seriesData, List upperBoundaryValues) {
        accessor.setUpperBoundaryValues(seriesData, upperBoundaryValues);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy