TipoAutenticazioneGestoreCredenziali.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.pdd.core.credenziali.engine;

  21. import java.io.Serializable;

  22. /**    
  23.  * TipoAutenticazioneGestoreCredenziali
  24.  *
  25.  * @author Poli Andrea (poli@link.it)
  26.  * @author $Author$
  27.  * @version $Rev$, $Date$
  28.  */
  29. public enum TipoAutenticazioneGestoreCredenziali implements Serializable {

  30.     NONE ("none"),
  31.     SSL ("ssl"),
  32.     BASIC ("basic"),
  33.     PRINCIPAL ("principal");

  34.     private final String valore;

  35.     TipoAutenticazioneGestoreCredenziali(String valore)
  36.     {
  37.         this.valore = valore;
  38.     }

  39.     public String getValore()
  40.     {
  41.         return this.valore;
  42.     }

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

  61.     public static TipoAutenticazioneGestoreCredenziali toEnumConstant(String val){
  62.         TipoAutenticazioneGestoreCredenziali res = null;
  63.         for (TipoAutenticazioneGestoreCredenziali tmp : values()) {
  64.             if(tmp.getValore().equals(val)){
  65.                 res = tmp;
  66.                 break;
  67.             }
  68.         }
  69.         return res;
  70.     }

  71.    
  72.     @Override
  73.     public String toString(){
  74.         return this.valore;
  75.     }
  76.     public boolean equals(String esito){
  77.         if(esito==null) {
  78.             return false;
  79.         }
  80.         return this.toString().equals(esito);
  81.     }

  82. }