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

com.gooddata.executeafm.response.TotalHeaderItem Maven / Gradle / Ivy

There is a newer version: 3.11.1+api3
Show newest version
/*
 * Copyright (C) 2007-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.executeafm.response;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.gooddata.md.report.Total;
import com.gooddata.util.GoodDataToStringBuilder;

import static com.gooddata.util.Validate.notNull;

/**
 * Header of total
 */
@JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)
@JsonTypeName("totalHeaderItem")
public class TotalHeaderItem {

    private final String name;

    /**
     * Creates new header
     * @param name total name
     */
    @JsonCreator
    public TotalHeaderItem(@JsonProperty("name") final String name) {
        this.name = name;
    }

    /**
     * Creates new header
     * @param total total value
     */
    public TotalHeaderItem(final Total total) {
        this(notNull(total, "total").toString());
    }

    /**
     * @return name of total
     */
    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return GoodDataToStringBuilder.defaultToString(this);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy