{"action":"created","comment":{"url":"https://api.github.com/repos/jgheerardyn/yields/pulls/comments/26852138","id":26852138,"diff_hunk":"@@ -0,0 +1,77 @@\n+/*\n+ * Copyright 2014 by Yields.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *        http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package io.yields.math.framework.kpi;\n+\n+import com.fasterxml.jackson.annotation.JsonIdentityInfo;\n+import com.fasterxml.jackson.annotation.ObjectIdGenerators;\n+\n+import org.apache.commons.lang.Validate;\n+\n+import java.io.Serializable;\n+import java.util.DoubleSummaryStatistics;\n+\n+/**\n+ * @author Tim Rombauts\n+ */\n+@JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class, property = \"@id\")\n+public class StatDefinition extends Definition implements Serializable {\n+\n+    private Double minValue;\n+\n+    private Double maxValue;\n+\n+    private Double referenceLevel;\n+\n+\n+\n+    public StatDefinition(String name) {\n+        this(name, null, null, null, null);\n+    }\n+\n+    public StatDefinition(String name, StatDefinition parent, DoubleSummaryStatistics stats, double referenceLevel) {\n+        this(name, parent, stats.getMin(), stats.getMax(), referenceLevel);\n+    }\n+\n+    public StatDefinition(String name, StatDefinition parent, Double minValue, Double maxValue, Double referenceLevel) {\n+        super(parent, name);\n+        if (minValue != null && maxValue != null && referenceLevel != null) {\n+            Validate.isTrue(minValue <= referenceLevel && referenceLevel <= maxValue);","path":"foundations/src/main/java/io/yields/math/framework/kpi/StatDefinition.java","position":51,"original_position":51,"commit_id":"94bf1b8737d6f0e2c4f4c7dc8efac6cb552f1f18","original_commit_id":"94bf1b8737d6f0e2c4f4c7dc8efac6cb552f1f18","user":{"login":"jgheerardyn","id":6535557,"avatar_url":"https://avatars.githubusercontent.com/u/6535557?v=3","gravatar_id":"","url":"https://api.github.com/users/jgheerardyn","html_url":"https://github.com/jgheerardyn","followers_url":"https://api.github.com/users/jgheerardyn/followers","following_url":"https://api.github.com/users/jgheerardyn/following{/other_user}","gists_url":"https://api.github.com/users/jgheerardyn/gists{/gist_id}","starred_url":"https://api.github.com/users/jgheerardyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgheerardyn/subscriptions","organizations_url":"https://api.github.com/users/jgheerardyn/orgs","repos_url":"https://api.github.com/users/jgheerardyn/repos","events_url":"https://api.github.com/users/jgheerardyn/events{/privacy}","received_events_url":"https://api.github.com/users/jgheerardyn/received_events","type":"User","site_admin":false},"body":"not really since the ref level, min and max value only make sense for the leaves in the tree, i.e. to the nodes at the end. Ideally, our tree object should only have StatDefinition objects at the lowest level.","created_at":"2015-03-20T16:13:52Z","updated_at":"2015-03-20T16:13:52Z","html_url":"https://github.com/jgheerardyn/yields/pull/80#discussion_r26852138","pull_request_url":"https://api.github.com/repos/jgheerardyn/yields/pulls/80","_links":{"self":{"href":"https://api.github.com/repos/jgheerardyn/yields/pulls/comments/26852138"},"html":{"href":"https://github.com/jgheerardyn/yields/pull/80#discussion_r26852138"},"pull_request":{"href":"https://api.github.com/repos/jgheerardyn/yields/pulls/80"}}},"pull_request":{"url":"https://api.github.com/repos/jgheerardyn/yields/pulls/80","id":31278738,"html_url":"https://github.com/jgheerardyn/yields/pull/80","diff_url":"https://github.com/jgheerardyn/yields/pull/80.diff","patch_url":"https://github.com/jgheerardyn/yields/pull/80.patch","issue_url":"https://api.github.com/repos/jgheerardyn/yields/issues/80","number":80,"state":"closed","locked":false,"title":"27","user":{"login":"jgheerardyn","id":6535557,"avatar_url":"https://avatars.githubusercontent.com/u/6535557?v=3","gravatar_id":"","url":"https://api.github.com/users/jgheerardyn","html_url":"https://github.com/jgheerardyn","followers_url":"https://api.github.com/users/jgheerardyn/followers","following_url":"https://api.github.com/users/jgheerardyn/following{/other_user}","gists_url":"https://api.github.com/users/jgheerardyn/gists{/gist_id}","starred_url":"https://api.github.com/users/jgheerardyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgheerardyn/subscriptions","organizations_url":"https://api.github.com/users/jgheerardyn/orgs","repos_url":"https://api.github.com/users/jgheerardyn/repos","events_url":"https://api.github.com/users/jgheerardyn/events{/privacy}","received_events_url":"https://api.github.com/users/jgheerardyn/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-16T19:59:29Z","updated_at":"2015-03-20T16:13:52Z","closed_at":"2015-03-17T21:55:03Z","merged_at":"2015-03-17T21:55:03Z","merge_commit_sha":"b20314114b0728c000203eaa2861710b99159fc5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jgheerardyn/yields/pulls/80/commits","review_comments_url":"https://api.github.com/repos/jgheerardyn/yields/pulls/80/comments","review_comment_url":"https://api.github.com/repos/jgheerardyn/yields/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jgheerardyn/yields/issues/80/comments","statuses_url":"https://api.github.com/repos/jgheerardyn/yields/statuses/94bf1b8737d6f0e2c4f4c7dc8efac6cb552f1f18","head":{"label":"jgheerardyn:27","ref":"27","sha":"94bf1b8737d6f0e2c4f4c7dc8efac6cb552f1f18","user":{"login":"jgheerardyn","id":6535557,"avatar_url":"https://avatars.githubusercontent.com/u/6535557?v=3","gravatar_id":"","url":"https://api.github.com/users/jgheerardyn","html_url":"https://github.com/jgheerardyn","followers_url":"https://api.github.com/users/jgheerardyn/followers","following_url":"https://api.github.com/users/jgheerardyn/following{/other_user}","gists_url":"https://api.github.com/users/jgheerardyn/gists{/gist_id}","starred_url":"https://api.github.com/users/jgheerardyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgheerardyn/subscriptions","organizations_url":"https://api.github.com/users/jgheerardyn/orgs","repos_url":"https://api.github.com/users/jgheerardyn/repos","events_url":"https://api.github.com/users/jgheerardyn/events{/privacy}","received_events_url":"https://api.github.com/users/jgheerardyn/received_events","type":"User","site_admin":false},"repo":{"id":24840606,"name":"yields","full_name":"jgheerardyn/yields","owner":{"login":"jgheerardyn","id":6535557,"avatar_url":"https://avatars.githubusercontent.com/u/6535557?v=3","gravatar_id":"","url":"https://api.github.com/users/jgheerardyn","html_url":"https://github.com/jgheerardyn","followers_url":"https://api.github.com/users/jgheerardyn/followers","following_url":"https://api.github.com/users/jgheerardyn/following{/other_user}","gists_url":"https://api.github.com/users/jgheerardyn/gists{/gist_id}","starred_url":"https://api.github.com/users/jgheerardyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgheerardyn/subscriptions","organizations_url":"https://api.github.com/users/jgheerardyn/orgs","repos_url":"https://api.github.com/users/jgheerardyn/repos","events_url":"https://api.github.com/users/jgheerardyn/events{/privacy}","received_events_url":"https://api.github.com/users/jgheerardyn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jgheerardyn/yields","description":"Mathematic software testing framework","fork":false,"url":"https://api.github.com/repos/jgheerardyn/yields","forks_url":"https://api.github.com/repos/jgheerardyn/yields/forks","keys_url":"https://api.github.com/repos/jgheerardyn/yields/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jgheerardyn/yields/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jgheerardyn/yields/teams","hooks_url":"https://api.github.com/repos/jgheerardyn/yields/hooks","issue_events_url":"https://api.github.com/repos/jgheerardyn/yields/issues/events{/number}","events_url":"https://api.github.com/repos/jgheerardyn/yields/events","assignees_url":"https://api.github.com/repos/jgheerardyn/yields/assignees{/user}","branches_url":"https://api.github.com/repos/jgheerardyn/yields/branches{/branch}","tags_url":"https://api.github.com/repos/jgheerardyn/yields/tags","blobs_url":"https://api.github.com/repos/jgheerardyn/yields/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jgheerardyn/yields/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jgheerardyn/yields/git/refs{/sha}","trees_url":"https://api.github.com/repos/jgheerardyn/yields/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jgheerardyn/yields/statuses/{sha}","languages_url":"https://api.github.com/repos/jgheerardyn/yields/languages","stargazers_url":"https://api.github.com/repos/jgheerardyn/yields/stargazers","contributors_url":"https://api.github.com/repos/jgheerardyn/yields/contributors","subscribers_url":"https://api.github.com/repos/jgheerardyn/yields/subscribers","subscription_url":"https://api.github.com/repos/jgheerardyn/yields/subscription","commits_url":"https://api.github.com/repos/jgheerardyn/yields/commits{/sha}","git_commits_url":"https://api.github.com/repos/jgheerardyn/yields/git/commits{/sha}","comments_url":"https://api.github.com/repos/jgheerardyn/yields/comments{/number}","issue_comment_url":"https://api.github.com/repos/jgheerardyn/yields/issues/comments{/number}","contents_url":"https://api.github.com/repos/jgheerardyn/yields/contents/{+path}","compare_url":"https://api.github.com/repos/jgheerardyn/yields/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jgheerardyn/yields/merges","archive_url":"https://api.github.com/repos/jgheerardyn/yields/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jgheerardyn/yields/downloads","issues_url":"https://api.github.com/repos/jgheerardyn/yields/issues{/number}","pulls_url":"https://api.github.com/repos/jgheerardyn/yields/pulls{/number}","milestones_url":"https://api.github.com/repos/jgheerardyn/yields/milestones{/number}","notifications_url":"https://api.github.com/repos/jgheerardyn/yields/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jgheerardyn/yields/labels{/name}","releases_url":"https://api.github.com/repos/jgheerardyn/yields/releases{/id}","created_at":"2014-10-06T09:45:19Z","updated_at":"2015-03-18T22:17:16Z","pushed_at":"2015-03-18T22:17:15Z","git_url":"git://github.com/jgheerardyn/yields.git","ssh_url":"git@github.com:jgheerardyn/yields.git","clone_url":"https://github.com/jgheerardyn/yields.git","svn_url":"https://github.com/jgheerardyn/yields","homepage":null,"size":2322,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"jgheerardyn:master","ref":"master","sha":"a93f495db712e810c15271e4b9f56bbd413ccd88","user":{"login":"jgheerardyn","id":6535557,"avatar_url":"https://avatars.githubusercontent.com/u/6535557?v=3","gravatar_id":"","url":"https://api.github.com/users/jgheerardyn","html_url":"https://github.com/jgheerardyn","followers_url":"https://api.github.com/users/jgheerardyn/followers","following_url":"https://api.github.com/users/jgheerardyn/following{/other_user}","gists_url":"https://api.github.com/users/jgheerardyn/gists{/gist_id}","starred_url":"https://api.github.com/users/jgheerardyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgheerardyn/subscriptions","organizations_url":"https://api.github.com/users/jgheerardyn/orgs","repos_url":"https://api.github.com/users/jgheerardyn/repos","events_url":"https://api.github.com/users/jgheerardyn/events{/privacy}","received_events_url":"https://api.github.com/users/jgheerardyn/received_events","type":"User","site_admin":false},"repo":{"id":24840606,"name":"yields","full_name":"jgheerardyn/yields","owner":{"login":"jgheerardyn","id":6535557,"avatar_url":"https://avatars.githubusercontent.com/u/6535557?v=3","gravatar_id":"","url":"https://api.github.com/users/jgheerardyn","html_url":"https://github.com/jgheerardyn","followers_url":"https://api.github.com/users/jgheerardyn/followers","following_url":"https://api.github.com/users/jgheerardyn/following{/other_user}","gists_url":"https://api.github.com/users/jgheerardyn/gists{/gist_id}","starred_url":"https://api.github.com/users/jgheerardyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgheerardyn/subscriptions","organizations_url":"https://api.github.com/users/jgheerardyn/orgs","repos_url":"https://api.github.com/users/jgheerardyn/repos","events_url":"https://api.github.com/users/jgheerardyn/events{/privacy}","received_events_url":"https://api.github.com/users/jgheerardyn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jgheerardyn/yields","description":"Mathematic software testing framework","fork":false,"url":"https://api.github.com/repos/jgheerardyn/yields","forks_url":"https://api.github.com/repos/jgheerardyn/yields/forks","keys_url":"https://api.github.com/repos/jgheerardyn/yields/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jgheerardyn/yields/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jgheerardyn/yields/teams","hooks_url":"https://api.github.com/repos/jgheerardyn/yields/hooks","issue_events_url":"https://api.github.com/repos/jgheerardyn/yields/issues/events{/number}","events_url":"https://api.github.com/repos/jgheerardyn/yields/events","assignees_url":"https://api.github.com/repos/jgheerardyn/yields/assignees{/user}","branches_url":"https://api.github.com/repos/jgheerardyn/yields/branches{/branch}","tags_url":"https://api.github.com/repos/jgheerardyn/yields/tags","blobs_url":"https://api.github.com/repos/jgheerardyn/yields/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jgheerardyn/yields/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jgheerardyn/yields/git/refs{/sha}","trees_url":"https://api.github.com/repos/jgheerardyn/yields/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jgheerardyn/yields/statuses/{sha}","languages_url":"https://api.github.com/repos/jgheerardyn/yields/languages","stargazers_url":"https://api.github.com/repos/jgheerardyn/yields/stargazers","contributors_url":"https://api.github.com/repos/jgheerardyn/yields/contributors","subscribers_url":"https://api.github.com/repos/jgheerardyn/yields/subscribers","subscription_url":"https://api.github.com/repos/jgheerardyn/yields/subscription","commits_url":"https://api.github.com/repos/jgheerardyn/yields/commits{/sha}","git_commits_url":"https://api.github.com/repos/jgheerardyn/yields/git/commits{/sha}","comments_url":"https://api.github.com/repos/jgheerardyn/yields/comments{/number}","issue_comment_url":"https://api.github.com/repos/jgheerardyn/yields/issues/comments{/number}","contents_url":"https://api.github.com/repos/jgheerardyn/yields/contents/{+path}","compare_url":"https://api.github.com/repos/jgheerardyn/yields/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jgheerardyn/yields/merges","archive_url":"https://api.github.com/repos/jgheerardyn/yields/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jgheerardyn/yields/downloads","issues_url":"https://api.github.com/repos/jgheerardyn/yields/issues{/number}","pulls_url":"https://api.github.com/repos/jgheerardyn/yields/pulls{/number}","milestones_url":"https://api.github.com/repos/jgheerardyn/yields/milestones{/number}","notifications_url":"https://api.github.com/repos/jgheerardyn/yields/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jgheerardyn/yields/labels{/name}","releases_url":"https://api.github.com/repos/jgheerardyn/yields/releases{/id}","created_at":"2014-10-06T09:45:19Z","updated_at":"2015-03-18T22:17:16Z","pushed_at":"2015-03-18T22:17:15Z","git_url":"git://github.com/jgheerardyn/yields.git","ssh_url":"git@github.com:jgheerardyn/yields.git","clone_url":"https://github.com/jgheerardyn/yields.git","svn_url":"https://github.com/jgheerardyn/yields","homepage":null,"size":2322,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jgheerardyn/yields/pulls/80"},"html":{"href":"https://github.com/jgheerardyn/yields/pull/80"},"issue":{"href":"https://api.github.com/repos/jgheerardyn/yields/issues/80"},"comments":{"href":"https://api.github.com/repos/jgheerardyn/yields/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/jgheerardyn/yields/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/jgheerardyn/yields/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jgheerardyn/yields/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/jgheerardyn/yields/statuses/94bf1b8737d6f0e2c4f4c7dc8efac6cb552f1f18"}}}}