AccordoCooperazione.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */


  20. package it.gov.spcoop.sica.dao;

  21. import java.io.Serializable;
  22. import java.util.ArrayList;

  23. import it.gov.spcoop.sica.firma.Firma;

  24. /**
  25.  * Package accordo di cooperazione
  26.  *
  27.  *
  28.  * @author Poli Andrea (apoli@link.it)
  29.  * @author $Author$
  30.  * @version $Rev$, $Date$
  31.  */
  32. public class AccordoCooperazione implements Serializable{

  33.     /**
  34.      *
  35.      */
  36.     private static final long serialVersionUID = 5643644790808146349L;

  37.     /** Contiene la firma apposta dal Servizio di Registro quando l'accordo viene scaricato dal Registro stesso  */
  38.     private Firma firma;

  39.     /** Contiene i metadati associati all'Accordo di Cooperazione. */
  40.     private it.gov.spcoop.sica.manifest.AccordoCooperazione manifesto;

  41.     /** Allegati */
  42.     private ArrayList<Documento> allegati = new ArrayList<Documento>();

  43.     /** Specifica semiformale */
  44.     private ArrayList<Documento> specificheSemiformali = new ArrayList<Documento>();


  45.     public Firma getFirma() {
  46.         return this.firma;
  47.     }

  48.     public void setFirma(Firma firma) {
  49.         this.firma = firma;
  50.     }

  51.     public it.gov.spcoop.sica.manifest.AccordoCooperazione getManifesto() {
  52.         return this.manifesto;
  53.     }

  54.     public void setManifesto(it.gov.spcoop.sica.manifest.AccordoCooperazione manifesto) {
  55.         this.manifesto = manifesto;
  56.     }

  57.     public void addAllegato(Documento allegato) {
  58.         this.allegati.add(allegato);
  59.     }

  60.     public Documento getAllegato(int index) {
  61.         return this.allegati.get( index );
  62.     }

  63.     public Documento removeAllegato(int index) {
  64.         return this.allegati.remove( index );
  65.     }

  66.     public Documento[] getAllegati() {
  67.         Documento[] array = new Documento[1];
  68.         if(this.allegati.size()>0){
  69.             return this.allegati.toArray(array);
  70.         }else{
  71.             return null;
  72.         }
  73.     }

  74.     public void setAllegati(Documento[] array) {
  75.         if(array!=null){
  76.             this.allegati.clear();
  77.             for(int i=0; i<array.length; i++){
  78.                 this.allegati.add(array[i]);
  79.             }
  80.         }
  81.     }

  82.     public int sizeAllegati() {
  83.         return this.allegati.size();
  84.     }
  85.    
  86.     public void addSpecificaSemiformale(Documento specificaSemiformale) {
  87.         this.specificheSemiformali.add(specificaSemiformale);
  88.     }

  89.     public Documento getSpecificaSemiformale(int index) {
  90.         return this.specificheSemiformali.get( index );
  91.     }

  92.     public Documento removeSpecificaSemiformale(int index) {
  93.         return this.specificheSemiformali.remove( index );
  94.     }

  95.     public Documento[] getSpecificheSemiformali() {
  96.         Documento[] array = new Documento[1];
  97.         if(this.specificheSemiformali.size()>0){
  98.             return this.specificheSemiformali.toArray(array);
  99.         }else{
  100.             return null;
  101.         }
  102.     }

  103.     public void setSpecificheSemiformali(Documento[] array) {
  104.         if(array!=null){
  105.             this.specificheSemiformali.clear();
  106.             for(int i=0; i<array.length; i++){
  107.                 this.specificheSemiformali.add(array[i]);
  108.             }
  109.         }
  110.     }

  111.     public int sizeSpecificheSemiformali() {
  112.         return this.specificheSemiformali.size();
  113.     }
  114. }