TipiDocumentoSicurezza.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 it.gov.spcoop.sica.manifest.driver;
  21. /**
  22.  *
  23.  *
  24.  * @author Stefano Corallo (corallo@link.it)
  25. * @author $Author$
  26. * @version $Rev$, $Date$
  27.  */
  28. public enum TipiDocumentoSicurezza {

  29.    
  30.     WSPOLICY ("WS-Policy"),
  31.     LINGUAGGIO_NATURALE ("Linguaggio Naturale");
  32.    
  33.    
  34.     private final String nome;

  35.     TipiDocumentoSicurezza(String nome)
  36.     {
  37.         this.nome = nome;
  38.     }

  39.     public String getNome()
  40.     {
  41.         return this.nome;
  42.     }
  43.    
  44.     @Override
  45.     public String toString(){
  46.         return this.nome;
  47.     }
  48.    
  49.     public static String[] toStringArray(){
  50.         String[] res = new String[TipiDocumentoSicurezza.values().length];
  51.         int i=0;
  52.         for (TipiDocumentoSicurezza tmp : TipiDocumentoSicurezza.values()) {
  53.             res[i]=tmp.toString();
  54.             i++;
  55.         }
  56.         return res;
  57.     }
  58.    
  59.     public static String[] toEnumNameArray(){
  60.         String[] res = new String[TipiDocumentoSicurezza.values().length];
  61.         int i=0;
  62.         for (TipiDocumentoSicurezza tmp : TipiDocumentoSicurezza.values()) {
  63.             res[i]=tmp.name();
  64.             i++;
  65.         }
  66.         return res;
  67.     }
  68.    
  69.     public static TipiDocumentoSicurezza toEnumConstant(String val){
  70.        
  71.         if(TipiDocumentoSicurezza.LINGUAGGIO_NATURALE.toString().equals(val)){
  72.             return TipiDocumentoSicurezza.LINGUAGGIO_NATURALE;
  73.         }else{
  74.             return TipiDocumentoSicurezza.WSPOLICY;
  75.         }
  76.        
  77.        
  78.     }
  79. }