Admin
Jan 12, 2023
16 comments
341
ObjectMapper objectMapper = new ObjectMapper(); String containerMatrixJSON = "{\"container_metrics\":{\"cpuRequest\":{\"results\":{\"general_info\":{\"sum\":4.4,\"mean\":1.1,\"units\":\"cores\"}}},\"cpuLimit\":{\"results\":{\"general_info\":{\"su...
Snippet
Java - Convert a JSON or Nested JSON into a Map
Admin
Jan 12, 2023
2 comments
669
ObjectMapper objectMapper = new ObjectMapper(); String containerMatrixJSON = "{\"container_metrics\":{\"cpuRequest\":{\"results\":{\"general_info\":{\"sum\":4.4,\"mean\":1.1,\"units\":\"cores\"}}},\"cpuLimit\":{\"results\":{\"general_info\":{\"su...
Snippet
Java - Convert a JSON or Nested JSON into a Map
Admin
Jan 12, 2023
4 comments
741
ObjectMapper objectMapper = new ObjectMapper(); String containerMatrixJSON = "{\"container_metrics\":{\"cpuRequest\":{\"results\":{\"general_info\":{\"sum\":4.4,\"mean\":1.1,\"units\":\"cores\"}}},\"cpuLimit\":{\"results\":{\"general_info\":{\"su...
Snippet
Java - Convert a JSON or Nested JSON into a Map
Admin
Jan 12, 2023
23 comments
141
ObjectMapper objectMapper = new ObjectMapper(); String containerMatrixJSON = "{\"container_metrics\":{\"cpuRequest\":{\"results\":{\"general_info\":{\"sum\":4.4,\"mean\":1.1,\"units\":\"cores\"}}},\"cpuLimit\":{\"results\":{\"general_info\":{\"su...
Snippet
Java - Convert a JSON or Nested JSON into a Map
Admin
Feb 25, 2022
24 comments
692
2.1. ClassLoader.getResourceAsStream() Use the getResourceAsStream() method to get the InputStream when reading a file from inside a jar file. Always use this method on the ClassLoader instance. private InputStream getFileAsIOStream(final St...
Snippet
Read a file from the ‘resources’ folder
Admin
Feb 25, 2022
15 comments
801
2.1. ClassLoader.getResourceAsStream() Use the getResourceAsStream() method to get the InputStream when reading a file from inside a jar file. Always use this method on the ClassLoader instance. private InputStream getFileAsIOStream(final St...
Snippet
Read a file from the ‘resources’ folder
Admin
Feb 25, 2022
22 comments
980
2.1. ClassLoader.getResourceAsStream() Use the getResourceAsStream() method to get the InputStream when reading a file from inside a jar file. Always use this method on the ClassLoader instance. private InputStream getFileAsIOStream(final St...
Snippet
Read a file from the ‘resources’ folder
Admin
Feb 25, 2022
20 comments
1.14K
2.1. ClassLoader.getResourceAsStream() Use the getResourceAsStream() method to get the InputStream when reading a file from inside a jar file. Always use this method on the ClassLoader instance. private InputStream getFileAsIOStream(final St...
Snippet
Read a file from the ‘resources’ folder
Admin
Feb 09, 2021
21 comments
845
String jsonData = "[\r\n" + " {\r\n" + " \"CompType\": \"Substrate\",\r\n" + " \"CompName\": \"80101-106DSA\",\r\n" + " \"CompRev\": \"BA\",\r\n" + " },\r\n" + " {\r\n" + " \"CompType\": \"Substrate\",\r\n" + " \"CompName\": \...
Snippet
Read JSON data into a list
Admin
Feb 09, 2021
6 comments
1.09K
String jsonData = "[\r\n" + " {\r\n" + " \"CompType\": \"Substrate\",\r\n" + " \"CompName\": \"80101-106DSA\",\r\n" + " \"CompRev\": \"BA\",\r\n" + " },\r\n" + " {\r\n" + " \"CompType\": \"Substrate\",\r\n" + " \"CompName\": \...
Snippet
Read JSON data into a list