diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-11-16 02:16:16 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-11-16 02:16:16 +0530 |
commit | da6b366397aa15e2686840c1d9ffa5dae5d49d2a (patch) | |
tree | a53bc42092a564bfbf66a67b70e3aa9cb8689798 /src/Server/JSONMessage.java |
First Commit
Diffstat (limited to 'src/Server/JSONMessage.java')
-rw-r--r-- | src/Server/JSONMessage.java | 19 |
1 files changed, 19 insertions, 0 deletions
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; + } +} |