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

  29.    
  30.     BPEL ("BPEL"),
  31.     WSCDL ("WS-CDL");
  32.    
  33.    
  34.     private final String nome;

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