/*
 * Copyright
 *   2007 axYus - www.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 Lesser General Public License as published by
 * the Free Software Foundation; either version 3 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser 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 com.google.gwt.user.client.rpc.IsSerializable;
import java.util.List;

/**
 * @author CBO
 * Représente les données nécessaires à l'initialisation d'une recherche.
 * Cette classe est utilisée dans deux cas :
 *  - Quand on arrive sur la page de recherche
 *  - Quand on ouvre un plugin de recherche
 */
public class SearchInitParametersDTO implements java.io.Serializable {

    private String pluginId;
    private int pluginType = 0;
    private List<CritereTypeDTO> mandatoryCritereTypes;
    private List<CritereTypeDTO> optionalCritereTypes;

    private SearchInitParametersDTO() {
        
    }
    /**
     * Use this constructor when it is a simple search
     * @param mandatoryCritereTypes
     */
    public SearchInitParametersDTO(List<CritereTypeDTO> mandatoryCritereTypes) {
        this.mandatoryCritereTypes = mandatoryCritereTypes;
    }
    public SearchInitParametersDTO(List<CritereTypeDTO> mandatoryCritereTypes, List<CritereTypeDTO> optionalCritereTypes) {
        this(mandatoryCritereTypes);
        this.optionalCritereTypes=optionalCritereTypes;
    }

    /**
     * Use this constructor when search is based on a plugin
     * @param mandatoryCritereTypes
     * @param optionalCritereTypes
     * @param pluginId
     */
    public SearchInitParametersDTO(List<CritereTypeDTO> mandatoryCritereTypes, List<CritereTypeDTO> optionalCritereTypes, String pluginId, int pluginType) {
        this(mandatoryCritereTypes,optionalCritereTypes);
        this.pluginId = pluginId;
        this.pluginType=pluginType;
    }

    public List<CritereTypeDTO> getMandatoryCritereTypes() {
        return mandatoryCritereTypes;
    }

    public List<CritereTypeDTO> getOptionalCritereTypes() {
        return optionalCritereTypes;
    }

    public String getPluginId() {
        return pluginId;
    }

    public int getPluginType() {
        return pluginType;
    }

}
