{"id":4091,"date":"2018-04-20T17:26:40","date_gmt":"2018-04-20T21:26:40","guid":{"rendered":"http:\/\/springframework.guru\/?p=4091"},"modified":"2019-06-24T20:25:00","modified_gmt":"2019-06-25T00:25:00","slug":"converting-java-map-to-list","status":"publish","type":"post","link":"https:\/\/springframework.guru\/converting-java-map-to-list\/","title":{"rendered":"Converting Java Map to List"},"content":{"rendered":"<p>Converting a Java <a href=\"https:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/Map.html\" target=\"_blank\" rel=\"noopener noreferrer\">Map<\/a> to a <a href=\"https:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/List.html\" target=\"_blank\" rel=\"noopener noreferrer\">List<\/a> is a very common task. <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Map<\/code> and <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">List<\/code> are common data structures used in Java. A <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Map<\/code> is a collection of key value pairs. While a\u00a0<code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">List<\/code> is an ordered collection of objects in which duplicate values can be stored.<\/p>\n<p>In this post, I will discuss different ways to convert a <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Map<\/code> to a <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">List<\/code>.<\/p>\n<p>For the example code in this post, I\u2019ll provide JUnit tests. If you are new to JUnit, I suggest you go through my series on <a href=\"http:\/\/springframework.guru\/unit-testing-junit-part-1\/\" target=\"_blank\" rel=\"noopener noreferrer\">Unit Testing with JUnit<\/a>.<\/p>\n<h2>Converting Map Keys to List<\/h2>\n<p>The <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Map<\/code> class comes with the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">keyset()<\/code> method that returns a <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Set<\/code> view of the keys contained in the map. The code to convert all the keys of a <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Map<\/code> to a <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Set<\/code> is this.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\">public List&lt;Integer&gt; convertMapKeysToList(Map&lt;Integer,String&gt; map){\r\n    List&lt;Integer&gt; listOfKeys = new ArrayList(map.keySet());\r\n    return listOfKeys;\r\n}<\/pre>\n<p>Here is the JUnit test code.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\">package springframework.guru;\r\n\r\nimport org.junit.After;\r\nimport org.junit.Before;\r\nimport org.junit.Test;\r\nimport org.hamcrest.collection.IsEmptyCollection;\r\nimport java.util.HashMap;\r\nimport java.util.List;\r\nimport java.util.Map;\r\nimport static org.hamcrest.CoreMatchers.not;\r\nimport static org.hamcrest.Matchers.hasSize;\r\nimport static org.hamcrest.core.IsCollectionContaining.hasItems;\r\nimport static org.junit.Assert.*;\r\nimport static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;\r\n\r\npublic class MapToListConverterTest {\r\n    MapToListConverter mapToListConverter;\r\n    Map&lt;Integer, String&gt; countryDialCodeMap;\r\n\r\n    @Before\r\n    public void setUp() throws Exception {\r\n        mapToListConverter = new MapToListConverter();\r\n        countryDialCodeMap = new HashMap&lt;&gt;();\r\n        countryDialCodeMap.put(1, \"United States\");\r\n        countryDialCodeMap.put(44, \"United Kingdom\");\r\n        countryDialCodeMap.put(27, \"South Africa\");\r\n        countryDialCodeMap.put(33, \"France\");\r\n        countryDialCodeMap.put(55, \"Brazil\");\r\n    }\r\n\r\n    @After\r\n    public void tearDown() throws Exception {\r\n        mapToListConverter=null;\r\n        countryDialCodeMap = null;\r\n    }\r\n\r\n    @Test\r\n    public void convertMapKeysToList(){\r\n        List&lt;Integer&gt; convertedListOfKeys = mapToListConverter.convertMapKeysToList(countryDialCodeMap);\r\n        assertThat(convertedListOfKeys, not(IsEmptyCollection.empty()));\r\n        assertThat(convertedListOfKeys, hasSize(5));\r\n        assertThat(convertedListOfKeys, containsInAnyOrder(1,33,44,27,55));\r\n        printList(convertedListOfKeys);\r\n    }\r\n\r\n    private void printList(List list){\r\n        list.stream().forEach(System.out::println);\r\n    }\r\n}<\/pre>\n<p>The output on running the test in IntelliJ is this.<br \/>\n<a href=\"http:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Key_To_List.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4092 size-full\" src=\"http:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Key_To_List.png\" alt=\"Test Output Java Map Key To List\" width=\"729\" height=\"191\" srcset=\"https:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Key_To_List.png 729w, https:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Key_To_List-300x79.png 300w\" sizes=\"(max-width: 729px) 100vw, 729px\" \/><\/a><\/p>\n<h2>Converting Map Values to List<\/h2>\n<p>You use the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">values()<\/code> method of <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Map<\/code> to convert all the values of <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Map<\/code> entries into a <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">List<\/code>.<\/p>\n<p>Here is the code to convert <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Map<\/code> values to a <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">List<\/code>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\">public List&lt;String&gt; convertMapValuesToList(Map&lt;Integer,String&gt; map){\r\n    List&lt;String&gt; listOfValues = new ArrayList(map.values());\r\n    return listOfValues;\r\n}<\/pre>\n<p>Here is the Junit test code.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\">@Test\r\npublic void convertMapValuesToList(){\r\n    List&lt;String&gt; convertedListOfValues = mapToListConverter.convertMapValuesToList(countryDialCodeMap);\r\n    assertThat(convertedListOfValues, not(IsEmptyCollection.empty()));\r\n    assertThat(convertedListOfValues, hasSize(5));\r\n    assertThat(convertedListOfValues, containsInAnyOrder(\"United States\", \"United Kingdom\", \"Brazil\", \"South Africa\", \"France\"));\r\n    printList(convertedListOfValues);\r\n}<\/pre>\n<p>The output on running the test in IntelliJ is this.<br \/>\n<a href=\"http:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Values_To_List.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4093\" src=\"http:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Values_To_List.png\" alt=\"Test Output Map Values to List\" width=\"732\" height=\"173\" srcset=\"https:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Values_To_List.png 732w, https:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Values_To_List-300x71.png 300w\" sizes=\"(max-width: 732px) 100vw, 732px\" \/><\/a><\/p>\n<h2>Converting Map to List using Java 8 Streams<\/h2>\n<p>If you are into functional programming style, you can use streams introduced in Java 8, along with some utility classes like <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Collectors<\/code>, which provides several useful methods to convert stream of <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Map<\/code> entries to <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">List<\/code>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\">public List&lt;Integer&gt; convertMapKeysToListWithStream(Map&lt;Integer,String&gt; map){\r\n List&lt;Integer&gt; listOfKeys2 = map.keySet().stream().collect(Collectors.toList());\r\n    return listOfKeys2;\r\n}<\/pre>\n<p>The <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">stream()<\/code> method return a stream of the keys from the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Set<\/code> of the map keys that <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Map.keySet()<\/code> returns. The <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">collect()<\/code> method of the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Stream<\/code> class is called to collect the results in a <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">List<\/code>.<\/p>\n<p>The <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Collectors.toList()<\/code> passed to the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">collect()<\/code> method is a generalized approach. You can collect elements of <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Stream<\/code> in specific collection, such as <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">ArrayList<\/code>, <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">LinkedList<\/code>, or any other <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">List<\/code> implementation. To do so, call the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">toColection()<\/code> method, like this.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\">List&lt;Integer&gt; listOfKeys2 = map.keySet().stream().collect(Collectors.toCollection(ArrayList::new));<\/pre>\n<p>Here is the JUnit test code.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\">@Test\r\npublic void convertMapKeysToListWithStream(){\r\n    List&lt;Integer&gt; convertedListOfKeys = mapToListConverter.convertMapKeysToListWithStream(countryDialCodeMap);\r\n    assertThat(convertedListOfKeys, not(IsEmptyCollection.empty()));\r\n    assertThat(convertedListOfKeys, hasSize(5));\r\n    assertThat(convertedListOfKeys, hasItems(33,27));\r\n    assertThat(convertedListOfKeys, containsInAnyOrder(1,33,44,27,55));\r\n    printList(convertedListOfKeys);\r\n}<\/pre>\n<p>The JUnit test output in IntelliJ is this.<br \/>\n<a href=\"http:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Keys_To_List_with_Stream.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4094 size-full\" src=\"http:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Keys_To_List_with_Stream.png\" alt=\"Test Output Java Map Keys To List with Java 8 Streams\" width=\"730\" height=\"194\" srcset=\"https:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Keys_To_List_with_Stream.png 730w, https:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Keys_To_List_with_Stream-300x80.png 300w\" sizes=\"(max-width: 730px) 100vw, 730px\" \/><\/a><\/p>\n<p>Converting <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Map<\/code> values to <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">List<\/code> using streams is similar. You only need to get the stream of <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Map<\/code> values that <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">map.values()<\/code> return, like this<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\">public List&lt;String&gt; convertMapValuesToListWithStream(Map&lt;Integer,String&gt; map){\r\n    List&lt;String&gt; listOfValues = map.values().stream().collect(Collectors.toCollection(ArrayList::new));\r\n    return listOfValues;\r\n}<\/pre>\n<p>The test code is this.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\">@Test\r\npublic void convertMapValuesToListWithStream(){\r\n    List&lt;String&gt; convertedListOfValues = mapToListConverter.convertMapValuesToListWithStream(countryDialCodeMap);\r\n    assertThat(convertedListOfValues, not(IsEmptyCollection.empty()));\r\n    assertThat(convertedListOfValues, hasSize(5));\r\n    assertThat(convertedListOfValues, hasItems(\"United States\",\"France\"));\r\n    assertThat(convertedListOfValues, containsInAnyOrder(\"United States\", \"United Kingdom\", \"Brazil\", \"South Africa\", \"France\"));\r\n    printList(convertedListOfValues);\r\n}<\/pre>\n<p>The test output in IntelliJ is this.<br \/>\n<a href=\"http:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Values_To_List_with_Stream.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4095\" src=\"http:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Values_To_List_with_Stream.png\" alt=\"Test Output Map Values To List with Stream\" width=\"730\" height=\"194\" srcset=\"https:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Values_To_List_with_Stream.png 730w, https:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Map_Values_To_List_with_Stream-300x80.png 300w\" sizes=\"(max-width: 730px) 100vw, 730px\" \/><\/a><\/p>\n<h2>Converting Generic Map to List using Stream and Java Lambdas<\/h2>\n<p>Till now I showed using method reference with stream to perform conversion of <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">Map<\/code> to <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">List<\/code>.<br \/>\nI personally prefer method reference over lambda expressions because I find them clear and concise.<br \/>\nAlso, when using collection, you will typically use generic collections and perform conversions between them.<\/p>\n<p>For such collections, you can use streams with lambda expressions, like this.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\">public static&lt;K, V&gt; List&lt;K&gt; convertGenericMapKeysToListWithStreamLambda(Map&lt;K,V&gt; map){\r\n    List&lt;K&gt; keyList = new ArrayList&lt;&gt;();\r\n    map.entrySet().stream().forEach(entry-&gt;\r\n      {keyList.add(entry.getKey());\r\n       });\r\n    return keyList;\r\n}<\/pre>\n<p>The code to use method reference is this.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\">public static&lt;K, V&gt; List&lt;V&gt; convertGenericMapValuesToListWithStreamMethodReference(Map&lt;K,V&gt; map){\r\n    List&lt;V&gt; keyList = new ArrayList&lt;&gt;();\r\n    map.values().stream().forEach(keyList::add);\r\n    return keyList;\r\n}<\/pre>\n<p>Here is the JUnit test code.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\">@Test\r\npublic void convertGenericMapKeysToListWithStreamLambda(){\r\n    List&lt;Integer&gt; convertedListOfKeys = mapToListConverter.convertGenericMapKeysToListWithStreamLambda(countryDialCodeMap);\r\n    assertThat(convertedListOfKeys, not(IsEmptyCollection.empty()));\r\n    assertThat(convertedListOfKeys, hasSize(5));\r\n    assertThat(convertedListOfKeys, hasItems(33,27));\r\n    assertThat(convertedListOfKeys, containsInAnyOrder(1,33,44,27,55));\r\n    printList(convertedListOfKeys);\r\n}\r\n\r\n@Test\r\npublic void convertGenericMapKeysToListWithStreamMethodReference(){\r\n    List&lt;String&gt; convertedListOfValues = mapToListConverter.convertGenericMapValuesToListWithStreamMethodReference(countryDialCodeMap);\r\n    assertThat(convertedListOfValues, not(IsEmptyCollection.empty()));\r\n    assertThat(convertedListOfValues, hasSize(5));\r\n    assertThat(convertedListOfValues, hasItems(\"United States\",\"France\"));\r\n    assertThat(convertedListOfValues, containsInAnyOrder(\"United States\", \"United Kingdom\", \"Brazil\", \"South Africa\", \"France\"));\r\n    printList(convertedListOfValues);\r\n}<\/pre>\n<p>The JUnit test output in IntelliJ is this.<br \/>\n<a href=\"http:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Generic_Map_To_List_with_Stream.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4096\" src=\"http:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Generic_Map_To_List_with_Stream.png\" alt=\"\" width=\"730\" height=\"268\" srcset=\"https:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Generic_Map_To_List_with_Stream.png 730w, https:\/\/springframework.guru\/wp-content\/uploads\/2018\/03\/Test_Output_Generic_Map_To_List_with_Stream-300x110.png 300w\" sizes=\"(max-width: 730px) 100vw, 730px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Converting a Java Map to a List is a very common task. Map and List are common data structures used in Java. A Map is a collection of key value pairs. While a\u00a0List is an ordered collection of objects in which duplicate values can be stored. In this post, I will discuss different ways to [&hellip;]<a href=\"https:\/\/springframework.guru\/converting-java-map-to-list\/\" class=\"df-link-excerpt\">Continue reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":4592,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[20],"tags":[27,199],"class_list":["post-4091","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-java","tag-java-map-to-list"],"jetpack_publicize_connections":[],"aioseo_notices":[],"modified_by":"Simanta","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/springframework.guru\/wp-content\/uploads\/2015\/03\/Banner560x292_07web.jpg","jetpack_shortlink":"https:\/\/wp.me\/p5BZrZ-13Z","_links":{"self":[{"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/posts\/4091"}],"collection":[{"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/comments?post=4091"}],"version-history":[{"count":10,"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/posts\/4091\/revisions"}],"predecessor-version":[{"id":5720,"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/posts\/4091\/revisions\/5720"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/media\/4592"}],"wp:attachment":[{"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/media?parent=4091"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/categories?post=4091"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/tags?post=4091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}