{"id":4284,"date":"2014-03-30T09:41:29","date_gmt":"2014-03-30T09:41:29","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/controlled-interface-implementation-collection-of-common-programming-errors\/"},"modified":"2014-03-30T09:41:29","modified_gmt":"2014-03-30T09:41:29","slug":"controlled-interface-implementation-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/controlled-interface-implementation-collection-of-common-programming-errors\/","title":{"rendered":"Controlled interface Implementation-Collection of common programming errors"},"content":{"rendered":"<p>In Serialization, the class which we want to be serialized has to implement the Serializable interface, otherwise a NotSerializableException is thrown. There are many other examples like that in the various features of Java. Now I just want to know how to bring in such control in custom classes and interfaces. I have an interface called Agent. There can be many different types of Agents, all of them must implement the Agent interface. I also have a class called Node. Nodes create Agents. Now how to bring in control in such a situation, such that an agent always much implement Agent interface, otherwise an exception will be thrown. I might sound a bit vague, but if someone can provide me with the general idea, then I can provide further details if necessary.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Serialization, the class which we want to be serialized has to implement the Serializable interface, otherwise a NotSerializableException is thrown. There are many other examples like that in the various features of Java. Now I just want to know how to bring in such control in custom classes and interfaces. I have an interface [&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-4284","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4284","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=4284"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4284\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}