{"id":4853,"date":"2014-03-30T16:07:33","date_gmt":"2014-03-30T16:07:33","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/using-interface-interface-on-the-context-collection-of-common-programming-errors\/"},"modified":"2014-03-30T16:07:33","modified_gmt":"2014-03-30T16:07:33","slug":"using-interface-interface-on-the-context-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/using-interface-interface-on-the-context-collection-of-common-programming-errors\/","title":{"rendered":"Using @interface interface on the context-Collection of common programming errors"},"content":{"rendered":"<p>I have one interface on the legacy project which defines as follows:<\/p>\n<pre><code>@Retention(RetentionPolicy.RUNTIME)\n@Target({ElementType.FIELD, ElementType.METHOD})\npublic @interface Statistic {\n\n    String name();\n\n}\n<\/code><\/pre>\n<p>.So here @interface are followed with two annotations i.e.(@Retention &amp; @Target). Is anybody can explain how this interface works and what would be the good place to use it. I am quite new with these one.<\/p>\n<p>Moreover, I can see on the project code somewhere using this interface with annotating like below:<\/p>\n<pre><code>@Statistic(name=\"DDB\/received\") private int docReceived = 0;\n<\/code><\/pre>\n<p>What does this really meant? Can anybody elaborate clearly? Thanks<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have one interface on the legacy project which defines as follows: @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.METHOD}) public @interface Statistic { String name(); } .So here @interface are followed with two annotations i.e.(@Retention &amp; @Target). Is anybody can explain how this interface works and what would be the good place to use it. I am quite new [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4853","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4853"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4853\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}