{"id":5596,"date":"2018-01-03T03:06:13","date_gmt":"2018-01-03T03:06:13","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=5596"},"modified":"2018-01-03T03:06:13","modified_gmt":"2018-01-03T03:06:13","slug":"box-unbox-primitive-scala","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/box-unbox-primitive-scala\/","title":{"rendered":"Box\/unbox a primitive in Scala"},"content":{"rendered":"<p>If you have a primitive type in Scala, you may need to &#8220;box&#8221; it, by turning it into a real JVM object, like so:<\/p>\n<pre lang=\"scala\">\nString.format(\"%-30s: %.2f \u00b1 %0.2f\", kv._1, Double.box(kv._2), Double.box(kv._3))\n<\/pre>\n<p>This creates &#8220;java.lang.Double&#8221; from &#8220;scala.Double&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Boxing primitives in scala<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[480],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5596"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=5596"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5596\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=5596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=5596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=5596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}