com.gooddata.md.report.AttributeInGrid Maven / Gradle / Ivy
/*
* Copyright (C) 2007-2014, GoodData(R) Corporation. All rights reserved.
*/
package com.gooddata.md.report;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
/**
* Attribute in Grid
*/
@JsonTypeName("attribute")
@JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class AttributeInGrid extends GridElement {
private Collection> totals;
@JsonCreator
AttributeInGrid(@JsonProperty("uri") String uri, @JsonProperty("totals") Collection> totals,
@JsonProperty("alias") String alias) {
super(uri, alias);
this.totals = totals;
}
public AttributeInGrid(String uri) {
super(uri, "");
totals = new ArrayList<>();
}
public AttributeInGrid(String uri, String alias) {
super(uri, alias);
totals = new ArrayList<>();
}
public Collection> getTotals() {
final LinkedList> result = new LinkedList<>();
for (final Collection t : totals) {
result.add(t);
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy