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

com.opsmatters.newrelic.batch.model.DashboardConfiguration Maven / Gradle / Ivy

/*
 * Copyright 2018 Gerald Curley
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.opsmatters.newrelic.batch.model;

import java.util.List;
import java.util.ArrayList;
import java.util.logging.Logger;
import com.opsmatters.newrelic.api.model.insights.Dashboard;

/**
 * Represents a set of dashboards.
 * 
 * @author Gerald Curley (opsmatters)
 */
public class DashboardConfiguration
{
    private static final Logger logger = Logger.getLogger(DashboardConfiguration.class.getName());

    private List dashboards = new ArrayList();

    /**
     * Default constructor.
     */
    public DashboardConfiguration()
    {
    }

    /**
     * Replaces the dashboards with the given set of dashboards.
     * @param dashboards The set of dashboards
     */
    public void setDashboards(List dashboards)
    {
        this.dashboards.clear();
        this.dashboards.addAll(dashboards);
    }

    /**
     * Adds the given dashboards to the current set of dashboards.
     * @param dashboards The dashboards to add
     */
    public void addDashboards(List dashboards)
    {
        this.dashboards.addAll(dashboards);
    }

    /**
     * Returns the set of dashboards.
     * @return The set of dashboards
     */
    public List getDashboards()
    {
        return dashboards;
    }

    /**
     * Returns the number of dashboards.
     * @return The number of dashboards
     */
    public int numDashboards()
    {
        return dashboards.size();
    }

    /**
     * Returns a string representation of the object.
     */
    @Override
    public String toString()
    {
        return "DashboardConfiguration [dashboards="+dashboards.size()+"]";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy