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

  29.    
  30.     UML ("UML"),
  31.     HTML ("HTML"),
  32.     XML ("XML"),
  33.     XSD ("XSD"),
  34.     JSON ("JSON"),
  35.     YAML ("YAML"),
  36.     LINGUAGGIO_NATURALE ("Linguaggio Naturale");
  37.    
  38.     private final String nome;

  39.     TipiDocumentoSemiformale(String nome)
  40.     {
  41.         this.nome = nome;
  42.     }

  43.     public String getNome()
  44.     {
  45.         return this.nome;
  46.     }
  47.    
  48.     @Override
  49.     public String toString(){
  50.         return this.nome;
  51.     }
  52.    
  53.     public static String[] toStringArray(){
  54.         String[] res = new String[TipiDocumentoSemiformale.values().length];
  55.         int i=0;
  56.         for (TipiDocumentoSemiformale tmp : TipiDocumentoSemiformale.values()) {
  57.             res[i]=tmp.toString();
  58.             i++;
  59.         }
  60.         return res;
  61.     }
  62.    
  63.     public static String[] toEnumNameArray(){
  64.         String[] res = new String[TipiDocumentoSemiformale.values().length];
  65.         int i=0;
  66.         for (TipiDocumentoSemiformale tmp : TipiDocumentoSemiformale.values()) {
  67.             res[i]=tmp.name();
  68.             i++;
  69.         }
  70.         return res;
  71.     }
  72.    
  73.     public static TipiDocumentoSemiformale toEnumConstant(String val){
  74.         TipiDocumentoSemiformale res = null;
  75.         if(TipiDocumentoSemiformale.LINGUAGGIO_NATURALE.toString().equals(val)){
  76.             res = TipiDocumentoSemiformale.LINGUAGGIO_NATURALE;
  77.         }else if(TipiDocumentoSemiformale.HTML.toString().equals(val)){
  78.             res = TipiDocumentoSemiformale.HTML;
  79.         }else if(TipiDocumentoSemiformale.UML.toString().equals(val)){
  80.             res = TipiDocumentoSemiformale.UML;
  81.         }else if(TipiDocumentoSemiformale.XML.toString().equals(val)){
  82.             res = TipiDocumentoSemiformale.XML;
  83.         }else if(TipiDocumentoSemiformale.XSD.toString().equals(val)){
  84.             res = TipiDocumentoSemiformale.XSD;
  85.         }else if(TipiDocumentoSemiformale.JSON.toString().equals(val)){
  86.             res = TipiDocumentoSemiformale.JSON;
  87.         }else if(TipiDocumentoSemiformale.YAML.toString().equals(val)){
  88.             res = TipiDocumentoSemiformale.YAML;
  89.         }
  90.        
  91.         return res;
  92.        
  93.     }
  94. }