/*
 * Copyright
 *   2009 axYus - www.axyus.com
 *   2009 C.Marchand - christophe.marchand@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.batch.imports.utils;

    
import java.sql.ResultSet;
import java.sql.SQLException;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class XemImportsFilesVOFull extends XemImportsFilesVOPK implements java.io.Serializable {
            
        
        
    /**
     * MAPS FILE_TYPE column.
     */
    protected java.lang.String fileType;
    protected boolean isFileTypeSet = false;
    protected boolean isFileTypeModified = false;
    
        
        
    /**
     * MAPS STATUS column.
     */
    protected java.lang.Integer status;
    protected boolean isStatusSet = false;
    protected boolean isStatusModified = false;
    
        
        
    /**
     * MAPS COLLECTIVITE column.
     */
    protected java.lang.String collectivite;
    protected boolean isCollectiviteSet = false;
    protected boolean isCollectiviteModified = false;
    
        
        
    /**
     * MAPS BUDGET column.
     */
    protected java.lang.String budget;
    protected boolean isBudgetSet = false;
    protected boolean isBudgetModified = false;
    
        
        
    /**
     * MAPS COLLECTIVITE_LIB column.
     */
    protected java.lang.String collectiviteLib;
    protected boolean isCollectiviteLibSet = false;
    protected boolean isCollectiviteLibModified = false;
    
        
        
    /**
     * MAPS BUDGET_LIB column.
     */
    protected java.lang.String budgetLib;
    protected boolean isBudgetLibSet = false;
    protected boolean isBudgetLibModified = false;
    
        
        
    /**
     * MAPS ERROR_MESSAGE column.
     */
    protected java.lang.String errorMessage;
    protected boolean isErrorMessageSet = false;
    protected boolean isErrorMessageModified = false;
    
            
        
    /**
     * Default Constructor
     */
    public XemImportsFilesVOFull() {
        super();
    }
    /**
     * Constructs a new Full object, initializing only PK fileds.
     */
    public XemImportsFilesVOFull(java.lang.String importId, java.lang.String subFileName) {
        super(importId, subFileName);
    }
    public XemImportsFilesVOFull(ResultSet rs) throws SQLException {
        this();
        int i=1;
        setInnerImportId(rs.getString(i++));
            setInnerSubFileName(rs.getString(i++));
            setInnerFileType(rs.getString(i++));
            int statusTmp = rs.getInt(i++); if(!rs.wasNull()) setInnerStatus(new java.lang.Integer(statusTmp));
            setInnerCollectivite(rs.getString(i++));
            setInnerBudget(rs.getString(i++));
            setInnerCollectiviteLib(rs.getString(i++));
            setInnerBudgetLib(rs.getString(i++));
            setInnerErrorMessage(rs.getString(i++));
            
    }
    
            
                
        
        
    public java.lang.String getFileType() { return fileType; }
    public void setFileType(java.lang.String fileType) {
        this.fileType=fileType;
        this.isFileTypeModified = true;
    }
    protected void setInnerFileType(java.lang.String fileType) {
        this.fileType=fileType;
        this.isFileTypeSet = true;
    }
    public java.lang.String getStrFileType(java.lang.String returnInCaseOfNull) {
        return fileType!=null ? fileType.toString() : returnInCaseOfNull;
    }
    
            
                
        
        
    public java.lang.Integer getStatus() { return status; }
    public void setStatus(java.lang.Integer status) {
        this.status=status;
        this.isStatusModified = true;
    }
    protected void setInnerStatus(java.lang.Integer status) {
        this.status=status;
        this.isStatusSet = true;
    }
    public java.lang.String getStrStatus(java.lang.String returnInCaseOfNull) {
        return status!=null ? status.toString() : returnInCaseOfNull;
    }
    
            
                
        
        
    public java.lang.String getCollectivite() { return collectivite; }
    public void setCollectivite(java.lang.String collectivite) {
        this.collectivite=collectivite;
        this.isCollectiviteModified = true;
    }
    protected void setInnerCollectivite(java.lang.String collectivite) {
        this.collectivite=collectivite;
        this.isCollectiviteSet = true;
    }
    public java.lang.String getStrCollectivite(java.lang.String returnInCaseOfNull) {
        return collectivite!=null ? collectivite.toString() : returnInCaseOfNull;
    }
    
            
                
        
        
    public java.lang.String getBudget() { return budget; }
    public void setBudget(java.lang.String budget) {
        this.budget=budget;
        this.isBudgetModified = true;
    }
    protected void setInnerBudget(java.lang.String budget) {
        this.budget=budget;
        this.isBudgetSet = true;
    }
    public java.lang.String getStrBudget(java.lang.String returnInCaseOfNull) {
        return budget!=null ? budget.toString() : returnInCaseOfNull;
    }
    
            
                
        
        
    public java.lang.String getCollectiviteLib() { return collectiviteLib; }
    public void setCollectiviteLib(java.lang.String collectiviteLib) {
        this.collectiviteLib=collectiviteLib;
        this.isCollectiviteLibModified = true;
    }
    protected void setInnerCollectiviteLib(java.lang.String collectiviteLib) {
        this.collectiviteLib=collectiviteLib;
        this.isCollectiviteLibSet = true;
    }
    public java.lang.String getStrCollectiviteLib(java.lang.String returnInCaseOfNull) {
        return collectiviteLib!=null ? collectiviteLib.toString() : returnInCaseOfNull;
    }
    
            
                
        
        
    public java.lang.String getBudgetLib() { return budgetLib; }
    public void setBudgetLib(java.lang.String budgetLib) {
        this.budgetLib=budgetLib;
        this.isBudgetLibModified = true;
    }
    protected void setInnerBudgetLib(java.lang.String budgetLib) {
        this.budgetLib=budgetLib;
        this.isBudgetLibSet = true;
    }
    public java.lang.String getStrBudgetLib(java.lang.String returnInCaseOfNull) {
        return budgetLib!=null ? budgetLib.toString() : returnInCaseOfNull;
    }
    
            
                
        
        
    public java.lang.String getErrorMessage() { return errorMessage; }
    public void setErrorMessage(java.lang.String errorMessage) {
        this.errorMessage=errorMessage;
        this.isErrorMessageModified = true;
    }
    protected void setInnerErrorMessage(java.lang.String errorMessage) {
        this.errorMessage=errorMessage;
        this.isErrorMessageSet = true;
    }
    public java.lang.String getStrErrorMessage(java.lang.String returnInCaseOfNull) {
        return errorMessage!=null ? errorMessage.toString() : returnInCaseOfNull;
    }
    
            
    public void validate() throws IllegalStateException {
            
            if(importId==null) throw new IllegalStateException("IMPORT_ID "+VoConstants.NOT_NULL_MSG);
        
            if(importId!=null &&importId.length()>IMPORT_ID_LEN) throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX+"IMPORT_ID"+VoConstants.TOO_LONG_MSG_SUFX);
        
            
            if(subFileName==null) throw new IllegalStateException("SUB_FILE_NAME "+VoConstants.NOT_NULL_MSG);
        
            if(subFileName!=null &&subFileName.length()>SUB_FILE_NAME_LEN) throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX+"SUB_FILE_NAME"+VoConstants.TOO_LONG_MSG_SUFX);
        
            
            if(fileType==null) throw new IllegalStateException("FILE_TYPE "+VoConstants.NOT_NULL_MSG);
        
            if(fileType!=null &&fileType.length()>FILE_TYPE_LEN) throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX+"FILE_TYPE"+VoConstants.TOO_LONG_MSG_SUFX);
        
            
            
            
            
            
            if(collectivite!=null &&collectivite.length()>COLLECTIVITE_LEN) throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX+"COLLECTIVITE"+VoConstants.TOO_LONG_MSG_SUFX);
        
            
            
            if(budget!=null &&budget.length()>BUDGET_LEN) throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX+"BUDGET"+VoConstants.TOO_LONG_MSG_SUFX);
        
            
            
            if(collectiviteLib!=null &&collectiviteLib.length()>COLLECTIVITE_LIB_LEN) throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX+"COLLECTIVITE_LIB"+VoConstants.TOO_LONG_MSG_SUFX);
        
            
            
            if(budgetLib!=null &&budgetLib.length()>BUDGET_LIB_LEN) throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX+"BUDGET_LIB"+VoConstants.TOO_LONG_MSG_SUFX);
        
            
            
            if(errorMessage!=null &&errorMessage.length()>ERROR_MESSAGE_LEN) throw new IllegalStateException(VoConstants.TOO_LONG_MSG_PRFX+"ERROR_MESSAGE"+VoConstants.TOO_LONG_MSG_SUFX);
        
            
    }
    
}
        