package br.com.centralit.citsmart.rest.v3.schema;

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

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import br.com.centralit.citsmart.rest.schema.CtMessageResp;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CtSynchronizeGetListResp", propOrder = {"amount", "requests"})
public class CtSynchronizeGetListResp extends CtMessageResp {

    @XmlElement(name = "Amount")
    protected int amount;

    @XmlElement(name = "Objects", required = true)
    protected List<CtSynchronize> objects;

    public int getAmount() {
        return amount = this.getObjects().size();
    }

    public void setAmount(final int amount) {
        this.amount = amount;
    }

    public List<CtSynchronize> getObjects() {
        if (objects == null) {
        	objects = new ArrayList<>();
        }
        return objects;
    }

}
