FiltroRicercaScope.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.driver;

  21. import java.io.Serializable;

  22. import org.openspcoop2.core.registry.constants.ScopeContesto;

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

  32. public class FiltroRicercaScope extends FiltroRicerca implements Serializable{

  33.     /**
  34.      *
  35.      */
  36.     private static final long serialVersionUID = 1L;
  37.    
  38.     /** ScopeTipologia */
  39.     private String tipologia;
  40.     /** ScopeContesto */
  41.     private ScopeContesto contesto;
  42.        
  43.     public ScopeContesto getContesto() {
  44.         return this.contesto;
  45.     }

  46.     public void setContesto(ScopeContesto contesto) {
  47.         this.contesto = contesto;
  48.     }

  49.     public String getTipologia() {
  50.         return this.tipologia;
  51.     }

  52.     public void setTipologia(String tipologia) {
  53.         this.tipologia = tipologia;
  54.     }

  55.     @Override
  56.     public String getTipo() {
  57.         if(this.tipologia!=null){
  58.             return this.tipologia;
  59.         }
  60.         return null;
  61.     }

  62.     @Override
  63.     public void setTipo(String tipo) {
  64.         this.tipologia = tipo;
  65.     }

  66.     @Override
  67.     public String toString(){
  68.         StringBuilder bf = new StringBuilder();
  69.         super.toString(false);
  70.         if(this.contesto!=null)
  71.             bf.append(" [contesto:"+this.contesto.getValue()+"]");
  72. //      Tipo gia' visualizzato con il super.toString        
  73. //      if(this.tipologia!=null)
  74. //          bf.append(" [tipologia:"+this.tipologia.getValue()+"]");
  75.         if(bf.length()=="Filtro:".length())
  76.             bf.append(" nessun filtro presente");
  77.         return bf.toString();
  78.     }
  79. }