EsitoIdentificationMode.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.protocol.utils;

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

  29.     STATIC ("static"),
  30.     SOAP_FAULT ("soapFault"),
  31.     CONTEXT_PROPERTY ("contextProperty");

  32.     private final String valore;

  33.     EsitoIdentificationMode(String valore)
  34.     {
  35.         this.valore = valore;
  36.     }

  37.     public String getValore()
  38.     {
  39.         return this.valore;
  40.     }

  41.     public static String[] toStringArray(){
  42.         String[] res = new String[EsitoIdentificationMode.values().length];
  43.         int i=0;
  44.         for (EsitoIdentificationMode tmp : EsitoIdentificationMode.values()) {
  45.             res[i]=tmp.getValore();
  46.             i++;
  47.         }
  48.         return res;
  49.     }
  50.     public static String[] toEnumNameArray(){
  51.         String[] res = new String[EsitoIdentificationMode.values().length];
  52.         int i=0;
  53.         for (EsitoIdentificationMode tmp : EsitoIdentificationMode.values()) {
  54.             res[i]=tmp.name();
  55.             i++;
  56.         }
  57.         return res;
  58.     }


  59.     public static EsitoIdentificationMode toEnumConstant(String val){

  60.         EsitoIdentificationMode res = null;

  61.         if(EsitoIdentificationMode.STATIC.toString().equals(val)){
  62.             res = EsitoIdentificationMode.STATIC;
  63.         }else if(EsitoIdentificationMode.SOAP_FAULT.toString().equals(val)){
  64.             res = EsitoIdentificationMode.SOAP_FAULT;
  65.         }else if(EsitoIdentificationMode.CONTEXT_PROPERTY.toString().equals(val)){
  66.             res = EsitoIdentificationMode.CONTEXT_PROPERTY;
  67.         }
  68.         return res;
  69.     }

  70.    
  71.     @Override
  72.     public String toString(){
  73.         return this.valore;
  74.     }
  75.     public boolean equals(String esito){
  76.         return this.toString().equals(esito);
  77.     }
  78.    
  79. }