MappingInfo.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.engine.mapping;

  21. import org.openspcoop2.protocol.engine.constants.ModalitaIdentificazione;

  22. /**
  23.  * MappingInfo
  24.  *
  25.  * @author Poli Andrea (apoli@link.it)
  26.  * @author $Author$
  27.  * @version $Rev$, $Date$
  28.  */
  29. public class MappingInfo {

  30.     private ModalitaIdentificazione modalitaIdentificazione;
  31.     private String value;
  32.     private String name;
  33.     private String pattern;
  34.     private String anonymous;
  35.     private Boolean forceWsdlBased;

  36.     public ModalitaIdentificazione getModalitaIdentificazione() {
  37.         return this.modalitaIdentificazione;
  38.     }
  39.     public void setModalitaIdentificazione(
  40.             ModalitaIdentificazione modalitaIdentificazione) {
  41.         this.modalitaIdentificazione = modalitaIdentificazione;
  42.     }
  43.     public String getValue() {
  44.         return this.value;
  45.     }
  46.     public void setValue(String value) {
  47.         this.value = value;
  48.     }
  49.     public String getName() {
  50.         return this.name;
  51.     }
  52.     public void setName(String name) {
  53.         this.name = name;
  54.     }
  55.     public String getPattern() {
  56.         return this.pattern;
  57.     }
  58.     public void setPattern(String pattern) {
  59.         this.pattern = pattern;
  60.     }
  61.     public String getAnonymous() {
  62.         return this.anonymous;
  63.     }
  64.     public void setAnonymous(String anonymous) {
  65.         this.anonymous = anonymous;
  66.     }
  67.     public Boolean getForceWsdlBased() {
  68.         return this.forceWsdlBased;
  69.     }
  70.     public void setForceWsdlBased(Boolean forceWsdlBased) {
  71.         this.forceWsdlBased = forceWsdlBased;
  72.     }
  73.    
  74.     @Override
  75.     public String toString(){
  76.         StringBuilder bf = new StringBuilder();
  77.         bf.append(this.modalitaIdentificazione.toString());
  78.        
  79.         if(this.value!=null){
  80.             if(bf.toString().contains("?")){
  81.                 bf.append("&");
  82.             }
  83.             else{
  84.                 bf.append("?");
  85.             }
  86.             bf.append("value=");
  87.             bf.append(this.value);
  88.         }
  89.        
  90.         if(this.name!=null){
  91.             if(bf.toString().contains("?")){
  92.                 bf.append("&");
  93.             }
  94.             else{
  95.                 bf.append("?");
  96.             }
  97.             bf.append("name=");
  98.             bf.append(this.name);
  99.         }
  100.        
  101.         if(this.pattern!=null){
  102.             if(bf.toString().contains("?")){
  103.                 bf.append("&");
  104.             }
  105.             else{
  106.                 bf.append("?");
  107.             }
  108.             bf.append("pattern=");
  109.             bf.append(this.pattern);
  110.         }
  111.        
  112.         if(this.anonymous!=null){
  113.             if(bf.toString().contains("?")){
  114.                 bf.append("&");
  115.             }
  116.             else{
  117.                 bf.append("?");
  118.             }
  119.             bf.append("anonymous=");
  120.             bf.append(this.anonymous);
  121.         }
  122.        
  123.         if(this.forceWsdlBased!=null){
  124.             if(bf.toString().contains("?")){
  125.                 bf.append("&");
  126.             }
  127.             else{
  128.                 bf.append("?");
  129.             }
  130.             bf.append("forceWsdlBased=");
  131.             bf.append(this.forceWsdlBased);
  132.         }
  133.        
  134.         return bf.toString();
  135.     }
  136. }