FiltroRicercaProtocolProperty.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.mapping;

  21. import java.io.Serializable;

  22. /**
  23.  * Permette il filtro di ricerca attraverso i driver che implementano l'interfaccia 'get'
  24.  *
  25.  *
  26.  * @author Poli Andrea (apoli@link.it)
  27.  * @author Nardi Lorenzo (nardi@link.it)
  28.  * @author $Author$
  29.  * @version $Rev$, $Date$
  30.  */

  31. public class FiltroRicercaProtocolProperty implements Serializable{

  32.    
  33.     /**
  34.      *
  35.      */
  36.     private static final long serialVersionUID = 1L;

  37.     /** Nome */
  38.     private String name;
  39.    
  40.     /** Valore */
  41.     private String valueAsString;
  42.    
  43.     /** ValoreNumerico */
  44.     private Long valueAsLong;
  45.    
  46.     /** ValoreBoolean */
  47.     private Boolean valueAsBoolean;
  48.    
  49.     public String getName() {
  50.         return this.name;
  51.     }
  52.     public void setName(String name) {
  53.         this.name = name;
  54.     }
  55.     public String getValueAsString() {
  56.         return this.valueAsString;
  57.     }
  58.     public void setValueAsString(String valore) {
  59.         this.valueAsString = valore;
  60.     }
  61.     public Long getValueAsLong() {
  62.         return this.valueAsLong;
  63.     }
  64.     public void setValueAsLong(Long valoreNumerico) {
  65.         this.valueAsLong = valoreNumerico;
  66.     }
  67.     public Boolean getValueAsBoolean() {
  68.         return this.valueAsBoolean;
  69.     }
  70.     public void setValueAsBoolean(Boolean valueAsBoolean) {
  71.         this.valueAsBoolean = valueAsBoolean;
  72.     }
  73.    
  74.     @Override
  75.     public String toString(){
  76.         return this.toString(true);
  77.     }
  78.     public String toString(boolean checkEmpty){
  79.         StringBuilder bf = new StringBuilder();
  80.         bf.append("FiltroProtocolProperty: ");
  81.         this.addDetails(bf);
  82.         if(checkEmpty){
  83.             if(bf.length()=="FiltroProtocolProperty: ".length()){
  84.                 bf.append(" nessun filtro presente");
  85.             }
  86.         }
  87.         return bf.toString();
  88.     }
  89.     public void addDetails(StringBuilder bf){
  90.         if(this.name!=null)
  91.             bf.append(" [name:"+this.name+"]");
  92.         if(this.valueAsString!=null)
  93.             bf.append(" [value-string:"+this.valueAsString+"]");
  94.         if(this.valueAsLong!=null)
  95.             bf.append(" [value-long:"+this.valueAsLong+"]");
  96.         if(this.valueAsBoolean!=null)
  97.             bf.append(" [value-boolean:"+this.valueAsBoolean+"]");
  98.     }
  99. }