TipoMessaggioEnum.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.monitor.rs.server.model;

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

  23. /**
  24.  * Gets or Sets TipoMessaggioEnum
  25.  */
  26. public enum TipoMessaggioEnum {
  27. RICHIESTA("richiesta"),
  28.   RISPOSTA("risposta"),
  29.   CONVERSAZIONE("conversazione"),
  30.   RIFERIMENTO_RICHIESTA("riferimento_richiesta");

  31.   private String value;

  32.   TipoMessaggioEnum(String value) {
  33.     this.value = value;
  34.   }

  35.   @Override
  36.   @JsonValue
  37.   public String toString() {
  38.     return String.valueOf(this.value);
  39.   }

  40.   @JsonCreator
  41.   public static TipoMessaggioEnum fromValue(String text) {
  42.     for (TipoMessaggioEnum b : TipoMessaggioEnum.values()) {
  43.       if (String.valueOf(b.value).equals(text)) {
  44.         return b;
  45.       }
  46.     }
  47.     return null;
  48.   }
  49.  
  50. }