package eu.dnetlib.clients.is;

import java.util.ArrayList;
import java.util.List;

public class CollectionDesc implements Comparable<CollectionDesc> {

	private String kind;
	private int size = 0;
	private List<CollectionTypeDesc> types = new ArrayList<>();

	public CollectionDesc() {}

	public CollectionDesc(final String kind, final List<CollectionTypeDesc> types, final int size) {
		this.kind = kind;
		this.types = types;
		this.size = size;
	}

	public CollectionDesc(final String kind) {
		this(kind, new ArrayList<CollectionTypeDesc>(), 0);
	}

	public String getKind() {
		return kind;
	}

	public void setKind(final String kind) {
		this.kind = kind;
	}

	public List<CollectionTypeDesc> getTypes() {
		return types;
	}

	public void setTypes(final List<CollectionTypeDesc> types) {
		this.types = types;
	}

	public void addType(final String type, final int n) {
		types.add(new CollectionTypeDesc(type, n));
		size += n;
	}

	public int getSize() {
		return size;
	}

	public void setSize(final int size) {
		this.size = size;
	}

	@Override
	public int compareTo(final CollectionDesc o) {
		return kind.compareTo(o.getKind());
	}

}
