ModalitaAutenticazioneGestoreCredenziali.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.  * ModalitaAutenticazioneGestoreCredenziali
  24.  *
  25.  * @author Poli Andrea (poli@link.it)
  26.  * @author $Author$
  27.  * @version $Rev$, $Date$
  28.  */
  29. public enum ModalitaAutenticazioneGestoreCredenziali implements Serializable {

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

  35.     private final String valore;

  36.     ModalitaAutenticazioneGestoreCredenziali(String valore)
  37.     {
  38.         this.valore = valore;
  39.     }

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

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

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

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

  83. }