ResourceRepresentation.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 org.openspcoop2.core.registry.constants.MessageType;
  28. import org.openspcoop2.core.registry.constants.RepresentationType;
  29. import java.io.Serializable;


  30. /** <p>Java class for resource-representation complex type.
  31.  *
  32.  * <p>The following schema fragment specifies the expected content contained within this class.
  33.  *
  34.  * <pre>
  35.  * &lt;complexType name="resource-representation"&gt;
  36.  *      &lt;sequence&gt;
  37.  *          &lt;element name="xml" type="{http://www.openspcoop2.org/core/registry}resource-representation-xml" minOccurs="0" maxOccurs="1"/&gt;
  38.  *          &lt;element name="json" type="{http://www.openspcoop2.org/core/registry}resource-representation-json" minOccurs="0" maxOccurs="1"/&gt;
  39.  *      &lt;/sequence&gt;
  40.  *      &lt;attribute name="media-type" type="{http://www.w3.org/2001/XMLSchema}string" use="required"/&gt;
  41.  *      &lt;attribute name="nome" type="{http://www.w3.org/2001/XMLSchema}string" use="optional"/&gt;
  42.  *      &lt;attribute name="descrizione" type="{http://www.w3.org/2001/XMLSchema}string" use="optional"/&gt;
  43.  *      &lt;attribute name="message-type" type="{http://www.openspcoop2.org/core/registry}MessageType" use="optional"/&gt;
  44.  *      &lt;attribute name="representation-type" type="{http://www.openspcoop2.org/core/registry}RepresentationType" use="optional"/&gt;
  45.  * &lt;/complexType&gt;
  46.  * </pre>
  47.  *
  48.  * @version $Rev$, $Date$
  49.  *
  50.  * @author Poli Andrea (poli@link.it)
  51.  * @author $Author$
  52.  * */

  53. @XmlAccessorType(XmlAccessType.FIELD)
  54. @XmlType(name = "resource-representation",
  55.   propOrder = {
  56.     "xml",
  57.     "json"
  58.   }
  59. )

  60. @XmlRootElement(name = "resource-representation")

  61. public class ResourceRepresentation extends org.openspcoop2.utils.beans.BaseBeanWithId implements Serializable , Cloneable {
  62.   public ResourceRepresentation() {
  63.     super();
  64.   }

  65.   public ResourceRepresentationXml getXml() {
  66.     return this.xml;
  67.   }

  68.   public void setXml(ResourceRepresentationXml xml) {
  69.     this.xml = xml;
  70.   }

  71.   public ResourceRepresentationJson getJson() {
  72.     return this.json;
  73.   }

  74.   public void setJson(ResourceRepresentationJson json) {
  75.     this.json = json;
  76.   }

  77.   public java.lang.String getMediaType() {
  78.     return this.mediaType;
  79.   }

  80.   public void setMediaType(java.lang.String mediaType) {
  81.     this.mediaType = mediaType;
  82.   }

  83.   public java.lang.String getNome() {
  84.     return this.nome;
  85.   }

  86.   public void setNome(java.lang.String nome) {
  87.     this.nome = nome;
  88.   }

  89.   public java.lang.String getDescrizione() {
  90.     return this.descrizione;
  91.   }

  92.   public void setDescrizione(java.lang.String descrizione) {
  93.     this.descrizione = descrizione;
  94.   }

  95.   public void setMessageTypeRawEnumValue(String value) {
  96.     this.messageType = (MessageType) MessageType.toEnumConstantFromString(value);
  97.   }

  98.   public String getMessageTypeRawEnumValue() {
  99.     if(this.messageType == null){
  100.         return null;
  101.     }else{
  102.         return this.messageType.toString();
  103.     }
  104.   }

  105.   public org.openspcoop2.core.registry.constants.MessageType getMessageType() {
  106.     return this.messageType;
  107.   }

  108.   public void setMessageType(org.openspcoop2.core.registry.constants.MessageType messageType) {
  109.     this.messageType = messageType;
  110.   }

  111.   public void setRepresentationTypeRawEnumValue(String value) {
  112.     this.representationType = (RepresentationType) RepresentationType.toEnumConstantFromString(value);
  113.   }

  114.   public String getRepresentationTypeRawEnumValue() {
  115.     if(this.representationType == null){
  116.         return null;
  117.     }else{
  118.         return this.representationType.toString();
  119.     }
  120.   }

  121.   public org.openspcoop2.core.registry.constants.RepresentationType getRepresentationType() {
  122.     return this.representationType;
  123.   }

  124.   public void setRepresentationType(org.openspcoop2.core.registry.constants.RepresentationType representationType) {
  125.     this.representationType = representationType;
  126.   }

  127.   private static final long serialVersionUID = 1L;



  128.   @XmlElement(name="xml",required=false,nillable=false)
  129.   protected ResourceRepresentationXml xml;

  130.   @XmlElement(name="json",required=false,nillable=false)
  131.   protected ResourceRepresentationJson json;

  132.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  133.   @XmlAttribute(name="media-type",required=true)
  134.   protected java.lang.String mediaType;

  135.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  136.   @XmlAttribute(name="nome",required=false)
  137.   protected java.lang.String nome;

  138.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  139.   @XmlAttribute(name="descrizione",required=false)
  140.   protected java.lang.String descrizione;

  141.   @javax.xml.bind.annotation.XmlTransient
  142.   protected java.lang.String messageTypeRawEnumValue;

  143.   @XmlAttribute(name="message-type",required=false)
  144.   protected MessageType messageType;

  145.   @javax.xml.bind.annotation.XmlTransient
  146.   protected java.lang.String representationTypeRawEnumValue;

  147.   @XmlAttribute(name="representation-type",required=false)
  148.   protected RepresentationType representationType;

  149. }