IdAccordoServizioParteComune.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 org.openspcoop2.core.registry;

  21. import javax.xml.bind.annotation.XmlAccessType;
  22. import javax.xml.bind.annotation.XmlAccessorType;
  23. import javax.xml.bind.annotation.XmlAttribute;
  24. import javax.xml.bind.annotation.XmlElement;
  25. import javax.xml.bind.annotation.XmlRootElement;
  26. import javax.xml.bind.annotation.XmlType;
  27. import java.io.Serializable;


  28. /** <p>Java class for id-accordo-servizio-parte-comune complex type.
  29.  *
  30.  * <p>The following schema fragment specifies the expected content contained within this class.
  31.  *
  32.  * <pre>
  33.  * &lt;complexType name="id-accordo-servizio-parte-comune"&gt;
  34.  *      &lt;sequence&gt;
  35.  *          &lt;element name="soggetto-referente" type="{http://www.openspcoop2.org/core/registry}id-soggetto" minOccurs="0" maxOccurs="1"/&gt;
  36.  *      &lt;/sequence&gt;
  37.  *      &lt;attribute name="nome" type="{http://www.w3.org/2001/XMLSchema}string" use="required"/&gt;
  38.  *      &lt;attribute name="versione" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" use="optional" default="1"/&gt;
  39.  * &lt;/complexType&gt;
  40.  * </pre>
  41.  *
  42.  * @version $Rev$, $Date$
  43.  *
  44.  * @author Poli Andrea (poli@link.it)
  45.  * @author $Author$
  46.  * */

  47. @XmlAccessorType(XmlAccessType.FIELD)
  48. @XmlType(name = "id-accordo-servizio-parte-comune",
  49.   propOrder = {
  50.     "soggettoReferente"
  51.   }
  52. )

  53. @XmlRootElement(name = "id-accordo-servizio-parte-comune")

  54. public class IdAccordoServizioParteComune extends org.openspcoop2.utils.beans.BaseBeanWithId implements Serializable , Cloneable {
  55.   public IdAccordoServizioParteComune() {
  56.     super();
  57.   }

  58.   public IdSoggetto getSoggettoReferente() {
  59.     return this.soggettoReferente;
  60.   }

  61.   public void setSoggettoReferente(IdSoggetto soggettoReferente) {
  62.     this.soggettoReferente = soggettoReferente;
  63.   }

  64.   public java.lang.String getNome() {
  65.     return this.nome;
  66.   }

  67.   public void setNome(java.lang.String nome) {
  68.     this.nome = nome;
  69.   }

  70.   public java.lang.Integer getVersione() {
  71.     return this.versione;
  72.   }

  73.   public void setVersione(java.lang.Integer versione) {
  74.     this.versione = versione;
  75.   }

  76.   private static final long serialVersionUID = 1L;



  77.   public IdAccordoServizioParteComune(org.openspcoop2.core.id.IDAccordo idAccordo){
  78.     if(idAccordo!=null){
  79.         this.nome = idAccordo.getNome();
  80.         this.versione = idAccordo.getVersione();
  81.         if(idAccordo.getSoggettoReferente()!=null){
  82.             this.soggettoReferente = new IdSoggetto();
  83.             this.soggettoReferente.setNome(idAccordo.getSoggettoReferente().getNome());
  84.             this.soggettoReferente.setTipo(idAccordo.getSoggettoReferente().getTipo());
  85.         }
  86.     }
  87.   }

  88.   @SuppressWarnings("deprecation")
  89.   public org.openspcoop2.core.id.IDAccordo toIDAccordo() throws org.openspcoop2.core.commons.CoreException{
  90.     if(this.nome==null){
  91.         throw new org.openspcoop2.core.commons.CoreException("Nome undefined");
  92.     }
  93.     try{
  94.         org.openspcoop2.core.id.IDAccordo id = new org.openspcoop2.core.id.IDAccordo();
  95.         id.setNome(this.nome);
  96.         id.setVersione(this.versione);
  97.         if(this.soggettoReferente!=null){
  98.             id.setSoggettoReferente(new org.openspcoop2.core.id.IDSoggetto(this.soggettoReferente.getTipo(),this.soggettoReferente.getNome()));
  99.         }
  100.         return id;
  101.     }catch(Exception e){
  102.         throw new org.openspcoop2.core.commons.CoreException(e.getMessage(),e);
  103.     }
  104.   }

  105.   @XmlElement(name="soggetto-referente",required=false,nillable=false)
  106.   protected IdSoggetto soggettoReferente;

  107.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  108.   @XmlAttribute(name="nome",required=true)
  109.   protected java.lang.String nome;

  110.   @javax.xml.bind.annotation.XmlSchemaType(name="unsignedInt")
  111.   @XmlAttribute(name="versione",required=false)
  112.   protected java.lang.Integer versione = java.lang.Integer.valueOf("1");

  113. }