ConnettoreEnum.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.config.rs.server.model;

  21. import com.fasterxml.jackson.annotation.JsonCreator;
  22. import com.fasterxml.jackson.annotation.JsonValue;

  23. /**
  24.  * Gets or Sets ConnettoreEnum
  25.  */
  26. public enum ConnettoreEnum {
  27. HTTP("http"),
  28.   FILE("file"),
  29.   JMS("jms"),
  30.   NULL("null"),
  31.   ECHO("echo"),
  32.   STATUS("status"),
  33.   PLUGIN("plugin"),
  34.   APPLICATIVO_SERVER("applicativo-server"),
  35.   MESSAGE_BOX("message-box");

  36.   private String value;

  37.   ConnettoreEnum(String value) {
  38.     this.value = value;
  39.   }

  40.   @Override
  41.   @JsonValue
  42.   public String toString() {
  43.     return String.valueOf(this.value);
  44.   }

  45.   @JsonCreator
  46.   public static ConnettoreEnum fromValue(String text) {
  47.     for (ConnettoreEnum b : ConnettoreEnum.values()) {
  48.       if (String.valueOf(b.value).equals(text)) {
  49.         return b;
  50.       }
  51.     }
  52.     return null;
  53.   }
  54.  
  55. }