ProfiloEnum.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.utils.service.beans;

  21. import com.fasterxml.jackson.annotation.JsonCreator;
  22. import com.fasterxml.jackson.annotation.JsonValue;
  23. import javax.xml.bind.annotation.XmlType;
  24. import javax.xml.bind.annotation.XmlEnum;
  25. import javax.xml.bind.annotation.XmlEnumValue;

  26. /**
  27.  * Gets or Sets ProfiloEnum
  28.  */
  29. @XmlType(name="ProfiloEnum")
  30. @XmlEnum(String.class)
  31. public enum ProfiloEnum {
  32.   @XmlEnumValue("APIGateway")
  33. APIGATEWAY("APIGateway"),
  34.     @XmlEnumValue("ModIPA")
  35. MODIPA("ModIPA"),
  36.     @XmlEnumValue("ModI")
  37. MODI("ModI"),
  38.     @XmlEnumValue("SPCoop")
  39. SPCOOP("SPCoop"),
  40.     @XmlEnumValue("FatturaPA")
  41. FATTURAPA("FatturaPA"),
  42.     @XmlEnumValue("eDelivery")
  43. EDELIVERY("eDelivery");

  44.   private String value;

  45.   ProfiloEnum(String value) {
  46.     this.value = value;
  47.   }

  48.   @Override
  49.   @JsonValue
  50.   public String toString() {
  51.     return String.valueOf(this.value);
  52.   }

  53.   @JsonCreator
  54.   public static ProfiloEnum fromValue(String text) {
  55.     for (ProfiloEnum b : ProfiloEnum.values()) {
  56.       if (String.valueOf(b.value).equals(text)) {
  57.         return b;
  58.       }
  59.     }
  60.     return null;
  61.   }
  62.  
  63. }