{"action":"created","comment":{"url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/pulls/comments/43615763","id":43615763,"diff_hunk":"@@ -0,0 +1,44 @@\n+package org.whaka.util;\r\n+\r\n+import java.util.concurrent.atomic.AtomicBoolean;\r\n+\r\n+import com.google.common.base.Preconditions;\r\n+\r\n+/**\r\n+ * <p>Abstract implementation of the {@link Initializable}. Provides default implementations for all methods.\r\n+ * \r\n+ * <p><b>Note:</b> {@link #isInitialized()} returns <code>false</code> by default, until {@link #initialize()}\r\n+ * won't be called for the first time! Unlike default {@link Initializable} implementation, where\r\n+ * {@link #isInitialized()} returns <code>true</code>. So extending this class automatically means that your\r\n+ * class does <b>need</b> the \"initialization\" context and will require to call {@link #initialize()} method.\r\n+ * \r\n+ * @see #doInitialize()\r\n+ * @see #assertInitialized()\r\n+ */\r\n+public abstract class AbstractInitializable implements Initializable {\r\n+\r\n+\tprivate final AtomicBoolean initialized = new AtomicBoolean();\r\n+\t\r\n+\t@Override\r\n+\tpublic void initialize() {\r\n+\t\tif (initialized.compareAndSet(false, true))\r\n+\t\t\tdoInitialize();\r\n+\t}\r\n+\t\r\n+\t/**\r\n+\t * This method will be called only when {@link #initialize()} is called <b>for the first time</b>.\r\n+\t */\r\n+\tprotected void doInitialize() {}\r\n+\t\r\n+\t@Override\r\n+\tpublic boolean isInitialized() {\r\n+\t\treturn initialized.get();\r\n+\t}\r\n+\t\r\n+\t/**\r\n+\t * @throws IllegalStateException if {@link #isInitialized()} returns <code>false</code>\r\n+\t */\r\n+\tprotected void assertInitialized() throws IllegalStateException {\r\n+\t\tPreconditions.checkState(isInitialized(), \"Instance cannot be used before 'initialize()' method is called!\");\r\n+\t}\r\n+}\r","path":"src/main/java/org/whaka/util/AbstractInitializable.java","position":44,"original_position":44,"commit_id":"8c6199b2db8e7fc366f387905eee059ce8978797","original_commit_id":"8c6199b2db8e7fc366f387905eee059ce8978797","user":{"login":"visitorus","id":13798091,"avatar_url":"https://avatars.githubusercontent.com/u/13798091?v=3","gravatar_id":"","url":"https://api.github.com/users/visitorus","html_url":"https://github.com/visitorus","followers_url":"https://api.github.com/users/visitorus/followers","following_url":"https://api.github.com/users/visitorus/following{/other_user}","gists_url":"https://api.github.com/users/visitorus/gists{/gist_id}","starred_url":"https://api.github.com/users/visitorus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/visitorus/subscriptions","organizations_url":"https://api.github.com/users/visitorus/orgs","repos_url":"https://api.github.com/users/visitorus/repos","events_url":"https://api.github.com/users/visitorus/events{/privacy}","received_events_url":"https://api.github.com/users/visitorus/received_events","type":"User","site_admin":false},"body":"Make all methods final except \"doInitialize\"","created_at":"2015-11-02T10:47:21Z","updated_at":"2015-11-02T10:47:21Z","html_url":"https://github.com/Whaka-project/whakamatautau-util/pull/99#discussion_r43615763","pull_request_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/pulls/99","_links":{"self":{"href":"https://api.github.com/repos/Whaka-project/whakamatautau-util/pulls/comments/43615763"},"html":{"href":"https://github.com/Whaka-project/whakamatautau-util/pull/99#discussion_r43615763"},"pull_request":{"href":"https://api.github.com/repos/Whaka-project/whakamatautau-util/pulls/99"}}},"pull_request":{"url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/pulls/99","id":49356677,"html_url":"https://github.com/Whaka-project/whakamatautau-util/pull/99","diff_url":"https://github.com/Whaka-project/whakamatautau-util/pull/99.diff","patch_url":"https://github.com/Whaka-project/whakamatautau-util/pull/99.patch","issue_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/issues/99","number":99,"state":"open","locked":false,"title":"Close #95 [Utils] Initializable and Destroyable","user":{"login":"vantuz-subhuman","id":5585355,"avatar_url":"https://avatars.githubusercontent.com/u/5585355?v=3","gravatar_id":"","url":"https://api.github.com/users/vantuz-subhuman","html_url":"https://github.com/vantuz-subhuman","followers_url":"https://api.github.com/users/vantuz-subhuman/followers","following_url":"https://api.github.com/users/vantuz-subhuman/following{/other_user}","gists_url":"https://api.github.com/users/vantuz-subhuman/gists{/gist_id}","starred_url":"https://api.github.com/users/vantuz-subhuman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vantuz-subhuman/subscriptions","organizations_url":"https://api.github.com/users/vantuz-subhuman/orgs","repos_url":"https://api.github.com/users/vantuz-subhuman/repos","events_url":"https://api.github.com/users/vantuz-subhuman/events{/privacy}","received_events_url":"https://api.github.com/users/vantuz-subhuman/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-31T19:25:42Z","updated_at":"2015-11-02T10:47:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"755c46d438638e8833147d4e957a3553f5969427","assignee":{"login":"visitorus","id":13798091,"avatar_url":"https://avatars.githubusercontent.com/u/13798091?v=3","gravatar_id":"","url":"https://api.github.com/users/visitorus","html_url":"https://github.com/visitorus","followers_url":"https://api.github.com/users/visitorus/followers","following_url":"https://api.github.com/users/visitorus/following{/other_user}","gists_url":"https://api.github.com/users/visitorus/gists{/gist_id}","starred_url":"https://api.github.com/users/visitorus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/visitorus/subscriptions","organizations_url":"https://api.github.com/users/visitorus/orgs","repos_url":"https://api.github.com/users/visitorus/repos","events_url":"https://api.github.com/users/visitorus/events{/privacy}","received_events_url":"https://api.github.com/users/visitorus/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/milestones/3","html_url":"https://github.com/Whaka-project/whakamatautau-util/milestones/Release:%200.0.9","labels_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/milestones/3/labels","id":1314593,"number":3,"title":"Release: 0.0.9","description":"Due date it extremely optional.\r\nIt's just that there aren't much features in the plans.","creator":{"login":"vantuz-subhuman","id":5585355,"avatar_url":"https://avatars.githubusercontent.com/u/5585355?v=3","gravatar_id":"","url":"https://api.github.com/users/vantuz-subhuman","html_url":"https://github.com/vantuz-subhuman","followers_url":"https://api.github.com/users/vantuz-subhuman/followers","following_url":"https://api.github.com/users/vantuz-subhuman/following{/other_user}","gists_url":"https://api.github.com/users/vantuz-subhuman/gists{/gist_id}","starred_url":"https://api.github.com/users/vantuz-subhuman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vantuz-subhuman/subscriptions","organizations_url":"https://api.github.com/users/vantuz-subhuman/orgs","repos_url":"https://api.github.com/users/vantuz-subhuman/repos","events_url":"https://api.github.com/users/vantuz-subhuman/events{/privacy}","received_events_url":"https://api.github.com/users/vantuz-subhuman/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":8,"state":"open","created_at":"2015-09-19T15:19:56Z","updated_at":"2015-11-02T10:11:42Z","due_on":"2015-12-30T21:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/pulls/99/commits","review_comments_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/pulls/99/comments","review_comment_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/issues/99/comments","statuses_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/statuses/8c6199b2db8e7fc366f387905eee059ce8978797","head":{"label":"Whaka-project:#95-Utils-Initializable-and-Destroyable","ref":"#95-Utils-Initializable-and-Destroyable","sha":"8c6199b2db8e7fc366f387905eee059ce8978797","user":{"login":"Whaka-project","id":13866233,"avatar_url":"https://avatars.githubusercontent.com/u/13866233?v=3","gravatar_id":"","url":"https://api.github.com/users/Whaka-project","html_url":"https://github.com/Whaka-project","followers_url":"https://api.github.com/users/Whaka-project/followers","following_url":"https://api.github.com/users/Whaka-project/following{/other_user}","gists_url":"https://api.github.com/users/Whaka-project/gists{/gist_id}","starred_url":"https://api.github.com/users/Whaka-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Whaka-project/subscriptions","organizations_url":"https://api.github.com/users/Whaka-project/orgs","repos_url":"https://api.github.com/users/Whaka-project/repos","events_url":"https://api.github.com/users/Whaka-project/events{/privacy}","received_events_url":"https://api.github.com/users/Whaka-project/received_events","type":"Organization","site_admin":false},"repo":{"id":40726014,"name":"whakamatautau-util","full_name":"Whaka-project/whakamatautau-util","owner":{"login":"Whaka-project","id":13866233,"avatar_url":"https://avatars.githubusercontent.com/u/13866233?v=3","gravatar_id":"","url":"https://api.github.com/users/Whaka-project","html_url":"https://github.com/Whaka-project","followers_url":"https://api.github.com/users/Whaka-project/followers","following_url":"https://api.github.com/users/Whaka-project/following{/other_user}","gists_url":"https://api.github.com/users/Whaka-project/gists{/gist_id}","starred_url":"https://api.github.com/users/Whaka-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Whaka-project/subscriptions","organizations_url":"https://api.github.com/users/Whaka-project/orgs","repos_url":"https://api.github.com/users/Whaka-project/repos","events_url":"https://api.github.com/users/Whaka-project/events{/privacy}","received_events_url":"https://api.github.com/users/Whaka-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Whaka-project/whakamatautau-util","description":"Set of utils useful for authomation testing and any everyday coding","fork":false,"url":"https://api.github.com/repos/Whaka-project/whakamatautau-util","forks_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/forks","keys_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/teams","hooks_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/hooks","issue_events_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/issues/events{/number}","events_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/events","assignees_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/assignees{/user}","branches_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/branches{/branch}","tags_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/tags","blobs_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/git/refs{/sha}","trees_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/statuses/{sha}","languages_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/languages","stargazers_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/stargazers","contributors_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/contributors","subscribers_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/subscribers","subscription_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/subscription","commits_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/commits{/sha}","git_commits_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/git/commits{/sha}","comments_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/comments{/number}","issue_comment_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/issues/comments{/number}","contents_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/contents/{+path}","compare_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/merges","archive_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/downloads","issues_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/issues{/number}","pulls_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/pulls{/number}","milestones_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/milestones{/number}","notifications_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/labels{/name}","releases_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/releases{/id}","created_at":"2015-08-14T16:52:16Z","updated_at":"2015-08-31T17:45:53Z","pushed_at":"2015-11-02T10:11:44Z","git_url":"git://github.com/Whaka-project/whakamatautau-util.git","ssh_url":"git@github.com:Whaka-project/whakamatautau-util.git","clone_url":"https://github.com/Whaka-project/whakamatautau-util.git","svn_url":"https://github.com/Whaka-project/whakamatautau-util","homepage":null,"size":939,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":17,"forks":1,"open_issues":17,"watchers":0,"default_branch":"master"}},"base":{"label":"Whaka-project:master","ref":"master","sha":"72a0afa0b62e92338e18059bbec1a25c2158de45","user":{"login":"Whaka-project","id":13866233,"avatar_url":"https://avatars.githubusercontent.com/u/13866233?v=3","gravatar_id":"","url":"https://api.github.com/users/Whaka-project","html_url":"https://github.com/Whaka-project","followers_url":"https://api.github.com/users/Whaka-project/followers","following_url":"https://api.github.com/users/Whaka-project/following{/other_user}","gists_url":"https://api.github.com/users/Whaka-project/gists{/gist_id}","starred_url":"https://api.github.com/users/Whaka-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Whaka-project/subscriptions","organizations_url":"https://api.github.com/users/Whaka-project/orgs","repos_url":"https://api.github.com/users/Whaka-project/repos","events_url":"https://api.github.com/users/Whaka-project/events{/privacy}","received_events_url":"https://api.github.com/users/Whaka-project/received_events","type":"Organization","site_admin":false},"repo":{"id":40726014,"name":"whakamatautau-util","full_name":"Whaka-project/whakamatautau-util","owner":{"login":"Whaka-project","id":13866233,"avatar_url":"https://avatars.githubusercontent.com/u/13866233?v=3","gravatar_id":"","url":"https://api.github.com/users/Whaka-project","html_url":"https://github.com/Whaka-project","followers_url":"https://api.github.com/users/Whaka-project/followers","following_url":"https://api.github.com/users/Whaka-project/following{/other_user}","gists_url":"https://api.github.com/users/Whaka-project/gists{/gist_id}","starred_url":"https://api.github.com/users/Whaka-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Whaka-project/subscriptions","organizations_url":"https://api.github.com/users/Whaka-project/orgs","repos_url":"https://api.github.com/users/Whaka-project/repos","events_url":"https://api.github.com/users/Whaka-project/events{/privacy}","received_events_url":"https://api.github.com/users/Whaka-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Whaka-project/whakamatautau-util","description":"Set of utils useful for authomation testing and any everyday coding","fork":false,"url":"https://api.github.com/repos/Whaka-project/whakamatautau-util","forks_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/forks","keys_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/teams","hooks_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/hooks","issue_events_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/issues/events{/number}","events_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/events","assignees_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/assignees{/user}","branches_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/branches{/branch}","tags_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/tags","blobs_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/git/refs{/sha}","trees_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/statuses/{sha}","languages_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/languages","stargazers_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/stargazers","contributors_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/contributors","subscribers_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/subscribers","subscription_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/subscription","commits_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/commits{/sha}","git_commits_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/git/commits{/sha}","comments_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/comments{/number}","issue_comment_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/issues/comments{/number}","contents_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/contents/{+path}","compare_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/merges","archive_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/downloads","issues_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/issues{/number}","pulls_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/pulls{/number}","milestones_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/milestones{/number}","notifications_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/labels{/name}","releases_url":"https://api.github.com/repos/Whaka-project/whakamatautau-util/releases{/id}","created_at":"2015-08-14T16:52:16Z","updated_at":"2015-08-31T17:45:53Z","pushed_at":"2015-11-02T10:11:44Z","git_url":"git://github.com/Whaka-project/whakamatautau-util.git","ssh_url":"git@github.com:Whaka-project/whakamatautau-util.git","clone_url":"https://github.com/Whaka-project/whakamatautau-util.git","svn_url":"https://github.com/Whaka-project/whakamatautau-util","homepage":null,"size":939,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":17,"forks":1,"open_issues":17,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Whaka-project/whakamatautau-util/pulls/99"},"html":{"href":"https://github.com/Whaka-project/whakamatautau-util/pull/99"},"issue":{"href":"https://api.github.com/repos/Whaka-project/whakamatautau-util/issues/99"},"comments":{"href":"https://api.github.com/repos/Whaka-project/whakamatautau-util/issues/99/comments"},"review_comments":{"href":"https://api.github.com/repos/Whaka-project/whakamatautau-util/pulls/99/comments"},"review_comment":{"href":"https://api.github.com/repos/Whaka-project/whakamatautau-util/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Whaka-project/whakamatautau-util/pulls/99/commits"},"statuses":{"href":"https://api.github.com/repos/Whaka-project/whakamatautau-util/statuses/8c6199b2db8e7fc366f387905eee059ce8978797"}}}}