TemporalConditionTypePredicate.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.wsbl.driver;


  21. /**
  22.  *
  23.  *
  24.  * @author Andrea Poli (apoli@link.it)
  25.  * @author $Author$
  26.  * @version $Rev$, $Date$
  27.  */
  28. public enum TemporalConditionTypePredicate {

  29.     C_INVOKE ("C-INVOKE"),
  30.     M_INVOKE ("M-INVOKE");
  31.    
  32.    
  33.     private final String nome;

  34.     TemporalConditionTypePredicate(String nome)
  35.     {
  36.         this.nome = nome;
  37.     }

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