/*
 * Copyright
 *   2008 axYus - www.axyus.com
 *   2008 C.Bosquet - charles.bosquet@axyus.com
 *
 * This file is part of XEMELIOS.
 *
 * XEMELIOS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * XEMELIOS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with XEMELIOS; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
package fr.gouv.finances.dgfip.xemelios.web.gwt.client.dto;

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

/**
 * @author CBO
 */
abstract public class InputCritereItemDTO extends CritereItemDTO {

    private String inputId;
    private List<InputCritereItemDTO> criteresDependants;
    private List<InputCritereItemDTO> criteresMaitres;

    protected InputCritereItemDTO() {
        this(null);
    }

    public InputCritereItemDTO(String inputId) {
        this.inputId = inputId;
        this.criteresDependants = new ArrayList<InputCritereItemDTO>();
        this.criteresMaitres =  new ArrayList<InputCritereItemDTO>();
    }

    public void addCritereMaitre(SelectOneCritereItemDTO critereMaitre) {
        this.criteresMaitres.add(critereMaitre);
    }

    public List<InputCritereItemDTO> getCriteresMaitres() {
        return criteresMaitres;
    }

    public String getInputId() {
        return inputId;
    }

    public void addCritereDependant(InputCritereItemDTO critereItem) {
        this.criteresDependants.add(critereItem);
    }

    public List<InputCritereItemDTO> getCriteresDependants() {
        return criteresDependants;
    }

    @Override
    public String toString() {
        return getInputId();
    }

}
