From 23a46b4be35277e06ec89f48730eeb694e686be8 Mon Sep 17 00:00:00 2001
From: Kenmegne <stephanie.kenmegne@gmail.com>
Date: Thu, 18 Jun 2026 15:40:06 +0000
Subject: [PATCH] add fdx-commons and fdx-consultation
---
fdx-commons/fdxcommons-model/src/main/java/com/megatim/fdxcommons/model/enumeration/Operateur.java | 79 +++++++++++++++++++++++++++++++++++++++
1 files changed, 79 insertions(+), 0 deletions(-)
diff --git a/fdx-commons/fdxcommons-model/src/main/java/com/megatim/fdxcommons/model/enumeration/Operateur.java b/fdx-commons/fdxcommons-model/src/main/java/com/megatim/fdxcommons/model/enumeration/Operateur.java
new file mode 100644
index 0000000..d364fac
--- /dev/null
+++ b/fdx-commons/fdxcommons-model/src/main/java/com/megatim/fdxcommons/model/enumeration/Operateur.java
@@ -0,0 +1,79 @@
+package com.megatim.fdxcommons.model.enumeration;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ *
+ * @author ASUS
+ */
+public enum Operateur {
+
+ LIKE("LIKE"),
+ EQUALS("="), NOT_EQUALS("<>"),
+ GREATER_THAN(">"), GREATER_OR_EQUALS_THAN(">="),
+ LOWER_THAN("<"), LOWER_OR_EQUALS_THAN("<="),
+ IN("IN"), NOT_IN("NOT IN"),
+ IS_NULL("IS NULL"), IS_NOT_NULL("IS NOT NULL"),
+ BETWEEN("BETWEEN"), NOT_BETWEEN("NOT BETWEEN");
+
+ private final String value;
+
+ private Operateur(String value) {
+ this.value = value;
+ }
+
+ public static Operateur fromValeur(String value) {
+ String cleanValue = value.trim().toUpperCase();
+ cleanValue = cleanValue.replaceAll("\\s+", " ");//remplacer plusieurs chaines vides par une seule chaine vide
+
+ switch (cleanValue) {
+
+ case "LIKE":
+ return Operateur.LIKE;
+
+ case "=":
+ return Operateur.EQUALS;
+
+ case "<>":
+ return Operateur.NOT_EQUALS;
+
+ case ">":
+ return Operateur.GREATER_THAN;
+
+ case ">=":
+ return Operateur.GREATER_OR_EQUALS_THAN;
+
+ case "<":
+ return Operateur.LOWER_THAN;
+
+ case "<=":
+ return Operateur.LOWER_OR_EQUALS_THAN;
+
+ case "IN":
+ return Operateur.IN;
+
+ case "NOT IN":
+ return Operateur.NOT_IN;
+
+ case "IS NULL":
+ return Operateur.IS_NULL;
+
+ case "IS NOT NULL":
+ return Operateur.IS_NOT_NULL;
+
+ case "BETWEEN":
+ return Operateur.BETWEEN;
+
+ case "NOT BETWEEN":
+ return Operateur.NOT_BETWEEN;
+
+ default:
+ return null;
+ }
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+}
--
Gitblit v1.10.0