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

com.gooddata.md.report.GridReportDefinitionContent Maven / Gradle / Ivy

There is a newer version: 3.11.1+api3
Show newest version
/*
 * Copyright (C) 2004-2017, GoodData(R) Corporation. All rights reserved.
 * This source code is licensed under the BSD-style license found in the
 * LICENSE.txt file in the root directory of this source tree.
 */
package com.gooddata.md.report;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.gooddata.md.Meta;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * Grid report definition
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GridReportDefinitionContent extends ReportDefinitionContent {

    private static final long serialVersionUID = 1296467241365069724L;
    public static final String FORMAT = "grid";

    @JsonCreator
    private GridReportDefinitionContent(
            @JsonProperty("format") String format,
            @JsonProperty("grid") Grid grid,
            @JsonProperty("filters") Collection filters) {
        super(format, grid, filters);
    }

    GridReportDefinitionContent(Grid grid, Collection filters) {
        this(FORMAT, grid, filters);
    }

    GridReportDefinitionContent(Grid grid) {
        this(grid, Collections.emptyList());
    }

    public String getFormat() {
        return FORMAT;
    }

    public static ReportDefinition create(String title, List columns, List rows,
                                          List metrics) {
        return create(title, columns, rows, metrics, Collections.emptyList());
    }

    public static ReportDefinition create(String title, List columns, List rows,
                                          List metrics, Collection filters) {
        return new ReportDefinition(new Meta(title), new GridReportDefinitionContent(new Grid(columns, rows, metrics), filters));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy