TracciaExtInfo.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.sdk.tracciamento;

  21. import java.util.ArrayList;
  22. import java.util.HashMap;
  23. import java.util.List;
  24. import java.util.Map;

  25. import org.openspcoop2.core.tracciamento.Proprieta;
  26. import org.openspcoop2.utils.MapEntry;

  27. /**
  28.  * Bean Contenente le informazioni relative alle sezioni contenenti informazioni extra
  29.  *
  30.  * @author $Author$
  31.  * @version $Rev$, $Date$
  32.  */
  33. public class TracciaExtInfo {

  34.     private boolean empty;
  35.     private String label;
  36.     private List<Proprieta> proprieta = new ArrayList<Proprieta>();
  37.    

  38.     public boolean isEmpty() {
  39.         return this.empty;
  40.     }
  41.     public void setEmpty(boolean empty) {
  42.         this.empty = empty;
  43.     }
  44.    
  45.     public List<Proprieta> getProprieta() {
  46.         return this.proprieta;
  47.     }
  48.     public Proprieta getProprieta(String name) {
  49.         for (Proprieta proprietaCheck : this.proprieta) {
  50.             if(proprietaCheck.getNome().equals(name)) {
  51.                 return proprietaCheck;
  52.             }
  53.         }
  54.         return null;
  55.     }
  56.     public Map<String, String> getProprietaAsMap(){
  57.         Map<String, String> map = new HashMap<>();
  58.         for (Proprieta proprietaCheck : this.proprieta) {
  59.             map.put(proprietaCheck.getNome(), proprietaCheck.getValore());
  60.         }
  61.         return map;
  62.     }
  63.     public List<Map.Entry<String, String>> getProprietaAsMapEntry(){
  64.         List<Map.Entry<String, String>> list = new ArrayList<>();
  65.         for (Proprieta proprietaCheck : this.proprieta) {
  66.             list.add(new MapEntry<String,String>(proprietaCheck.getNome(), proprietaCheck.getValore()));
  67.         }
  68.         return list;
  69.     }
  70.     public void setProprieta(List<Proprieta> proprieta) {
  71.         this.proprieta = proprieta;
  72.     }
  73.    
  74.     public String getLabel() {
  75.         return this.label;
  76.     }
  77.     public void setLabel(String label) {
  78.         this.label = label;
  79.     }
  80.    
  81. }