TipoPdD.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.constants;

  21. import java.io.Serializable;

  22. /**
  23.  * Contiene i tipi di una porta di dominio
  24.  *
  25.  * @author apoli@link.it
  26.  * @author $Author$
  27.  * @version $Rev$, $Date$
  28.  */

  29. public enum TipoPdD implements Serializable {

  30.     DELEGATA ("delegata"),
  31.     APPLICATIVA ("applicativa"),
  32.     INTEGRATION_MANAGER ("integrationManager"), // servizio di Message Box
  33.     ROUTER ("router");
  34.    
  35.    
  36.     private final String tipo;

  37.     TipoPdD(String tipo)
  38.     {
  39.         this.tipo = tipo;
  40.     }

  41.     public String getTipo()
  42.     {
  43.         return this.tipo;
  44.     }
  45.    
  46.     public boolean equals(String tipoPdD){
  47.         if(tipoPdD==null) {
  48.             return false;
  49.         }
  50.         return this.tipo.equals(tipoPdD);
  51.     }
  52.    
  53.     public static TipoPdD toTipoPdD(String value){
  54.         if(DELEGATA.getTipo().equals(value)){
  55.             return DELEGATA;
  56.         }
  57.         else if(APPLICATIVA.getTipo().equals(value)){
  58.             return APPLICATIVA;
  59.         }
  60.         else if(INTEGRATION_MANAGER.getTipo().equals(value)){
  61.             return INTEGRATION_MANAGER;
  62.         }
  63.         else if(ROUTER.getTipo().equals(value)){
  64.             return ROUTER;
  65.         }
  66.         else{
  67.             return null;
  68.         }
  69.     }
  70. }