TipiDocumentoSemiformale.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 TipiDocumentoSemiformale {

  29.    
  30.     UML ("UML"),
  31.     HTML ("HTML"),
  32.     XML ("XML"),
  33.     LINGUAGGIO_NATURALE ("Linguaggio Naturale");
  34.    
  35.     private final String nome;

  36.     TipiDocumentoSemiformale(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[TipiDocumentoSemiformale.values().length];
  52.         int i=0;
  53.         for (TipiDocumentoSemiformale tmp : TipiDocumentoSemiformale.values()) {
  54.             res[i]=tmp.toString();
  55.             i++;
  56.         }
  57.         return res;
  58.     }
  59.    
  60.     public static String[] toEnumNameArray(){
  61.         String[] res = new String[TipiDocumentoSemiformale.values().length];
  62.         int i=0;
  63.         for (TipiDocumentoSemiformale tmp : TipiDocumentoSemiformale.values()) {
  64.             res[i]=tmp.name();
  65.             i++;
  66.         }
  67.         return res;
  68.     }
  69.    
  70.     public static TipiDocumentoSemiformale toEnumConstant(String val){
  71.         TipiDocumentoSemiformale res = null;
  72.         if(TipiDocumentoSemiformale.LINGUAGGIO_NATURALE.toString().equals(val)){
  73.             res = TipiDocumentoSemiformale.LINGUAGGIO_NATURALE;
  74.         }else if(TipiDocumentoSemiformale.HTML.toString().equals(val)){
  75.             res = TipiDocumentoSemiformale.HTML;
  76.         }else if(TipiDocumentoSemiformale.UML.toString().equals(val)){
  77.             res = TipiDocumentoSemiformale.UML;
  78.         }else if(TipiDocumentoSemiformale.XML.toString().equals(val)){
  79.             res = TipiDocumentoSemiformale.XML;
  80.         }
  81.        
  82.         return res;
  83.        
  84.     }
  85. }