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 org.openspcoop2.core.registry.constants;
  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.     XACML_POLICY ("XACML-Policy"),
  32.     LINGUAGGIO_NATURALE ("Linguaggio Naturale");
  33.    
  34.    
  35.     private final String nome;

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

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