package com.huatek.busi.common;

import java.io.Serializable;
import java.util.List;

import com.google.common.collect.Lists;

import lombok.Data;

@Data
public class CurveType implements Serializable {

    private static final long serialVersionUID = 1L;

    private String titleText;

    private List<CurveSubType> series;

    public CurveType() {

    }

    public CurveType(String titleText, int seriesLength) {
        super();
        this.titleText = titleText;
        this.series = Lists.newArrayListWithCapacity(seriesLength);
    }

    public static CurveType newInstance(String titleText, int seriesLength) {
        return new CurveType(titleText, seriesLength);
    }

    public CurveType add(String column, String name) {
        this.series.add(new CurveSubType(column, name));
        return this;
    }

    public CurveType addAll(List<CurveSubType> items) {
        this.series.addAll(items);
        return this;
    }
}
