From da6b366397aa15e2686840c1d9ffa5dae5d49d2a Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sat, 16 Nov 2024 02:16:16 +0530 Subject: First Commit --- src/Server/JSONMessage.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/Server/JSONMessage.java (limited to 'src/Server/JSONMessage.java') diff --git a/src/Server/JSONMessage.java b/src/Server/JSONMessage.java new file mode 100644 index 0000000..c3f9712 --- /dev/null +++ b/src/Server/JSONMessage.java @@ -0,0 +1,19 @@ +package Server; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.util.Map; + +public class JSONMessage { + private Map data; + + public JSONMessage(String json) throws JsonProcessingException { + ObjectMapper mapper = new ObjectMapper(); + data = mapper.readValue(json, Map.class); + } + + public Map getData() { + return data; + } +} -- cgit v1.2.3