{"id":1420,"date":"2015-06-14T14:57:23","date_gmt":"2015-06-14T21:57:23","guid":{"rendered":"http:\/\/10kdev.net\/?p=1420"},"modified":"2015-08-04T15:03:50","modified_gmt":"2015-08-04T22:03:50","slug":"deprecating-a-java-enum-entry","status":"publish","type":"post","link":"http:\/\/10kdev.net\/?p=1420","title":{"rendered":"Deprecating a Java Enum Entry"},"content":{"rendered":"<p>Ran across this interesting tidbit about java enumerations: you can deprecate an entry. Although you&#8217;ll have to be careful if you have data tied to any legacy entries, in which case you are stuck with the entry or you&#8217;d have to do a data conversion if you decided to remove an entry.<\/p>\n<p>Let&#8217;s say you have a Currency name enumeration and you want to get rid of nickels, you could deprecate nickels with the <em>@Deprecated<\/em> annotation until you have time to update everything to the new specs:<\/p>\n<pre style=\"padding-left: 30px;\">public enum Currency {\r\n\r\nPENNY,\r\n@Deprecated\r\nNICKEL,\r\nDIME,\r\nQUARTER\r\n\r\n};\r\n\r\n<\/pre>\n<pre class=\"brush: java;\" style=\"padding-left: 30px;\">\r\nCurrencyType deprecatedNickel = CurrencyType.<del>NICKEL<\/del>;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Ran across this interesting tidbit about java enumerations: you can deprecate an entry. Although you&#8217;ll have to be careful if you have data tied to any legacy entries, in which case you are stuck with the entry or you&#8217;d have to do a data conversion if you decided to remove an entry. Let&#8217;s say you [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1420"}],"collection":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1420"}],"version-history":[{"count":10,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1420\/revisions"}],"predecessor-version":[{"id":1430,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1420\/revisions\/1430"}],"wp:attachment":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1420"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}