RestMediaTypeMapping.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.manifest;

  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.XmlRootElement;
  25. import javax.xml.bind.annotation.XmlType;
  26. import org.openspcoop2.protocol.manifest.constants.RestMessageType;
  27. import java.io.Serializable;


  28. /** <p>Java class for RestMediaTypeMapping complex type.
  29.  *
  30.  * <p>The following schema fragment specifies the expected content contained within this class.
  31.  *
  32.  * <pre>
  33.  * &lt;complexType name="RestMediaTypeMapping"&gt;
  34.  *      &lt;xsd:simpleContent&gt;
  35.  *          &lt;xsd:extension base="{http://www.w3.org/2001/XMLSchema}string"&gt;
  36.  *              &lt;attribute name="messageType" type="{http://www.openspcoop2.org/protocol/manifest}RestMessageType" use="required"/&gt;
  37.  *              &lt;attribute name="regExpr" type="{http://www.w3.org/2001/XMLSchema}boolean" use="optional" default="false"/&gt;
  38.  *          &lt;/xsd:extension&gt;
  39.  *      &lt;/xsd:simpleContent&gt;
  40.  * &lt;/complexType&gt;
  41.  * </pre>
  42.  *
  43.  * @version $Rev$, $Date$
  44.  *
  45.  * @author Poli Andrea (poli@link.it)
  46.  * @author $Author$
  47.  * */

  48. @XmlAccessorType(XmlAccessType.FIELD)
  49. @XmlType(name = "RestMediaTypeMapping")

  50. @XmlRootElement(name = "RestMediaTypeMapping")

  51. public class RestMediaTypeMapping extends org.openspcoop2.utils.beans.BaseBean implements Serializable , Cloneable {
  52.   public RestMediaTypeMapping() {
  53.     super();
  54.   }

  55.   public String getBase() {
  56.     if(this.base!=null && ("".equals(this.base)==false)){
  57.         return this.base.trim();
  58.     }else{
  59.         return null;
  60.     }

  61.   }

  62.   public void setBase(String base) {
  63.     this.base=base;
  64.   }

  65.   public void setMessageTypeRawEnumValue(String value) {
  66.     this.messageType = (RestMessageType) RestMessageType.toEnumConstantFromString(value);
  67.   }

  68.   public String getMessageTypeRawEnumValue() {
  69.     if(this.messageType == null){
  70.         return null;
  71.     }else{
  72.         return this.messageType.toString();
  73.     }
  74.   }

  75.   public org.openspcoop2.protocol.manifest.constants.RestMessageType getMessageType() {
  76.     return this.messageType;
  77.   }

  78.   public void setMessageType(org.openspcoop2.protocol.manifest.constants.RestMessageType messageType) {
  79.     this.messageType = messageType;
  80.   }

  81.   public boolean isRegExpr() {
  82.     return this.regExpr;
  83.   }

  84.   public boolean getRegExpr() {
  85.     return this.regExpr;
  86.   }

  87.   public void setRegExpr(boolean regExpr) {
  88.     this.regExpr = regExpr;
  89.   }

  90.   private static final long serialVersionUID = 1L;



  91.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  92.   @javax.xml.bind.annotation.XmlValue()
  93.   public String base;

  94.   @javax.xml.bind.annotation.XmlTransient
  95.   protected java.lang.String messageTypeRawEnumValue;

  96.   @XmlAttribute(name="messageType",required=true)
  97.   protected RestMessageType messageType;

  98.   @javax.xml.bind.annotation.XmlSchemaType(name="boolean")
  99.   @XmlAttribute(name="regExpr",required=false)
  100.   protected boolean regExpr = false;

  101. }