Allegato.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.protocol.sdk;


  21. /**
  22.  * Classe utilizzata per rappresentare un Allegato.
  23.  *
  24.  *
  25.  * @author Poli Andrea (apoli@link.it)
  26.  * @author $Author$
  27.  * @version $Rev$, $Date$
  28.  */

  29. public class Allegato implements java.io.Serializable, Cloneable {

  30.     /**
  31.      * serialVersionUID
  32.      */
  33.     private static final long serialVersionUID = 1L;

  34.     private org.openspcoop2.core.tracciamento.Allegato allegato;


  35.     /* ********  C O S T R U T T O R E  ******** */

  36.     /**
  37.      * Costruttore.
  38.      *
  39.      *
  40.      */
  41.     public Allegato(){
  42.         this.allegato = new org.openspcoop2.core.tracciamento.Allegato();
  43.     }
  44.     public Allegato(org.openspcoop2.core.tracciamento.Allegato allegato){
  45.         this.allegato = allegato;
  46.     }


  47.    
  48.     // base
  49.    
  50.     public org.openspcoop2.core.tracciamento.Allegato getAllegato() {
  51.         return this.allegato;
  52.     }
  53.     public void setAllegato(org.openspcoop2.core.tracciamento.Allegato allegato) {
  54.         this.allegato = allegato;
  55.     }
  56.    
  57.    

  58.     // id  [Wrapper]
  59.    
  60.     public Long getId() {
  61.         return this.allegato.getId();
  62.     }
  63.     public void setId(Long id) {
  64.         this.allegato.setId(id);
  65.     }

  66.    
  67.     // content-id  [Wrapper]
  68.    
  69.     public java.lang.String getContentId() {
  70.         return this.allegato.getContentId();
  71.     }
  72.     public void setContentId(java.lang.String contentId) {
  73.         this.allegato.setContentId(contentId);
  74.     }

  75.    
  76.     // content-location  [Wrapper]
  77.    
  78.     public java.lang.String getContentLocation() {
  79.         return this.allegato.getContentLocation();
  80.     }
  81.     public void setContentLocation(java.lang.String contentLocation) {
  82.         this.allegato.setContentLocation(contentLocation);
  83.     }

  84.    
  85.     // content-type  [Wrapper]
  86.    
  87.     public java.lang.String getContentType() {
  88.         return this.allegato.getContentType();
  89.     }
  90.     public void setContentType(java.lang.String contentType) {
  91.         this.allegato.setContentType(contentType);
  92.     }

  93.    
  94.     // digest  [Wrapper]
  95.    
  96.     public java.lang.String getDigest() {
  97.         return this.allegato.getDigest();
  98.     }
  99.     public void setDigest(java.lang.String digest) {
  100.         this.allegato.setDigest(digest);
  101.     }






  102.     @Override
  103.     public Allegato clone(){

  104.         // Non uso il base clone per far si che venga usato il costruttore new String()

  105.         Allegato clone = new Allegato();

  106.         clone.setId(this.getId()!=null ? Long.valueOf(this.getId()+"") : null);
  107.         clone.setContentId(this.getContentId()!=null ? new String(this.getContentId()) : null);
  108.         clone.setContentLocation(this.getContentLocation()!=null ? new String(this.getContentLocation()) : null);
  109.         clone.setContentType(this.getContentType()!=null ? new String(this.getContentType()) : null);
  110.         clone.setDigest(this.getDigest()!=null ? new String(this.getDigest()) : null);

  111.         return clone;
  112.     }
  113. }