{"action":"created","comment":{"url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/pulls/comments/45672230","id":45672230,"diff_hunk":"@@ -0,0 +1,475 @@\n+package com.hida;\r\n+\r\n+import java.io.IOException;\r\n+import java.util.HashMap;\r\n+import java.util.HashSet;\r\n+import java.util.Iterator;\r\n+import java.util.Set;\r\n+import org.codehaus.jackson.map.ObjectMapper;\r\n+\r\n+/**\r\n+ * Minter class creates formatted ids in json using a variety of parameters.\r\n+ *\r\n+ * @author Brittany Cruz\r\n+ * @author lruffin\r\n+ */\r\n+public class Minter {\r\n+\r\n+    private final static DatabaseManager DATABASE_MANAGER\r\n+            = new DatabaseManager();\r\n+    private final String CHAR_MAP;\r\n+    private final HashMap<Character, String> BASE_MAP = new HashMap();\r\n+\r\n+    // fields    \r\n+    private final String NAAN = \"/:ark/70111/\";\r\n+    private final String PREPEND;\r\n+    private final int AMOUNT;\r\n+    private final int LENGTH;\r\n+    private final String PREFIX;\r\n+    private final Set<String> ID_LIST;\r\n+    private final HashMap<String, String> tokenMaps = new HashMap();\r\n+\r\n+    /**\r\n+     * Instantiates an Ark minter that will generate the requested amount of ids\r\n+     *\r\n+     * @param CHAR_MAP\r\n+     * @param PREPEND\r\n+     * @param AMOUNT\r\n+     * @param LENGTH\r\n+     * @param PREFIX\r\n+     */\r\n+    public Minter(String CHAR_MAP, String PREPEND, int AMOUNT, int LENGTH,\r\n+            String PREFIX) {\r\n+        this.CHAR_MAP = CHAR_MAP;\r\n+        this.PREPEND = PREPEND;\r\n+        this.AMOUNT = AMOUNT;\r\n+        this.LENGTH = LENGTH;\r\n+        this.PREFIX = PREFIX;\r\n+        this.ID_LIST = new HashSet(AMOUNT);\r\n+\r\n+        // char mappings\r\n+        this.tokenMaps.put(\"DIGIT\", \"0123456789\");\r\n+        this.tokenMaps.put(\"LOWERCASE\", \"abcdefghijklmnopqrstuvwxyz\");\r\n+        this.tokenMaps.put(\"UPPERCASE\", \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\");\r\n+        this.tokenMaps.put(\"MIXCASE\",\r\n+                \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\");\r\n+        this.tokenMaps.put(\"EXTENDED\", \"0123456789abcdefghijklmnopqrstuvwxyz\");\r\n+        this.tokenMaps.put(\"ALPHANUMERIC\",\r\n+                \"0123456789abcdefghijklmnopqrstuvwxyz\"\r\n+                + \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\");\r\n+\r\n+        this.BASE_MAP.put('d', \"DIGIT\");\r\n+        this.BASE_MAP.put('l', \"LOWERCASE\");\r\n+        this.BASE_MAP.put('u', \"UPPERCASE\");\r\n+        this.BASE_MAP.put('m', \"MIXCASE\");\r\n+        this.BASE_MAP.put('e', \"EXTENDED\");\r\n+        this.BASE_MAP.put('a', \"ALPHANUMERIC\");\r\n+\r\n+    }\r\n+\r\n+    /**\r\n+     * genIDauto() Method description: This generates an automated ID format.\r\n+     * Note that this method will take longer and longer to create unique ids\r\n+     * because the ids it produces will randomize. Need to figure out a way to\r\n+     * quickly discover unminted ids in database.\r\n+     *\r\n+     * User would give a string that excepts 6 letters: {d, l, u, m, e, a}.\r\n+     * Similar to the Mode settings in genIDauto() method. d:\r\n+     *\r\n+     * <p>\r\n+     * DIGIT: {0123456789} Digit values only.</p>\r\n+     * <p>\r\n+     * LOWERCASE: {abc...xyz} Lowercase letters only. </p>\r\n+     * <p>\r\n+     * UPPERCASE: {ABC...XYZ} Uppercase letters only.</p>\r\n+     * <p>\r\n+     * MIXCASE: {abc...XYZ} Lowercase and Uppercase letters only. </p>\r\n+     * <p>\r\n+     * EXTENDED: {012...xyz} Digit values and Lowercase letters only. </p>\r\n+     * <p>\r\n+     * ALPHANUMERIC: {012...abc...XYZ} Digit values, Lowercase and Uppercase\r\n+     * letters.</p>\r\n+     *\r\n+     * @param token: There are 2 different modes to choose from. RANDOM: Value\r\n+     * by value, each value's order is randomized. SEQUENTIAL: Value by value,\r\n+     * each value's order is sequenced.\r\n+     * @return - The method checks to see if it is even possible to produce the\r\n+     * requested amount of ids using the given parameters. If it can't it'll\r\n+     * return an error message. Otherwise a reference to a JsonObject that\r\n+     * contains Json list of ids is returned.\r\n+     *\r\n+     */\r\n+    public String genIdAuto(String token) {\r\n+\r\n+        // checks to see if its possible to produce or add requested amount of\r\n+        // ids to database\r\n+        if (isPrefixAvailable(true, token)) {\r\n+            // creates a list to hold redundant ids\r\n+            Set<String> redundantIdList = new HashSet();\r","path":"src/main/java/com/hida/Minter.java","position":108,"original_position":108,"commit_id":"7a4368170277129c51d1ffe26a9853718fe4eca6","original_commit_id":"7a4368170277129c51d1ffe26a9853718fe4eca6","user":{"login":"dagnir","id":261310,"avatar_url":"https://avatars.githubusercontent.com/u/261310?v=3","gravatar_id":"","url":"https://api.github.com/users/dagnir","html_url":"https://github.com/dagnir","followers_url":"https://api.github.com/users/dagnir/followers","following_url":"https://api.github.com/users/dagnir/following{/other_user}","gists_url":"https://api.github.com/users/dagnir/gists{/gist_id}","starred_url":"https://api.github.com/users/dagnir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagnir/subscriptions","organizations_url":"https://api.github.com/users/dagnir/orgs","repos_url":"https://api.github.com/users/dagnir/repos","events_url":"https://api.github.com/users/dagnir/events{/privacy}","received_events_url":"https://api.github.com/users/dagnir/received_events","type":"User","site_admin":false},"body":"Specify datatype","created_at":"2015-11-23T22:42:53Z","updated_at":"2015-11-23T22:42:53Z","html_url":"https://github.com/lelandlopez/HDANoidTranslation/pull/3#discussion_r45672230","pull_request_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/pulls/comments/45672230"},"html":{"href":"https://github.com/lelandlopez/HDANoidTranslation/pull/3#discussion_r45672230"},"pull_request":{"href":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/pulls/3","id":51578951,"html_url":"https://github.com/lelandlopez/HDANoidTranslation/pull/3","diff_url":"https://github.com/lelandlopez/HDANoidTranslation/pull/3.diff","patch_url":"https://github.com/lelandlopez/HDANoidTranslation/pull/3.patch","issue_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/issues/3","number":3,"state":"open","locked":false,"title":"Webservice feedback","user":{"login":"dagnir","id":261310,"avatar_url":"https://avatars.githubusercontent.com/u/261310?v=3","gravatar_id":"","url":"https://api.github.com/users/dagnir","html_url":"https://github.com/dagnir","followers_url":"https://api.github.com/users/dagnir/followers","following_url":"https://api.github.com/users/dagnir/following{/other_user}","gists_url":"https://api.github.com/users/dagnir/gists{/gist_id}","starred_url":"https://api.github.com/users/dagnir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagnir/subscriptions","organizations_url":"https://api.github.com/users/dagnir/orgs","repos_url":"https://api.github.com/users/dagnir/repos","events_url":"https://api.github.com/users/dagnir/events{/privacy}","received_events_url":"https://api.github.com/users/dagnir/received_events","type":"User","site_admin":false},"body":":pencil: This PR is just meant to be a way for me to provide feedback on the `webservice` branch.  Don't merge ","created_at":"2015-11-23T20:57:17Z","updated_at":"2015-11-23T22:42:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2e0cd7146d1ac8940a1999630981b911f19a1c4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/pulls/3/commits","review_comments_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/pulls/3/comments","review_comment_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/issues/3/comments","statuses_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/statuses/7a4368170277129c51d1ffe26a9853718fe4eca6","head":{"label":"dagnir:webservice-feedback","ref":"webservice-feedback","sha":"7a4368170277129c51d1ffe26a9853718fe4eca6","user":{"login":"dagnir","id":261310,"avatar_url":"https://avatars.githubusercontent.com/u/261310?v=3","gravatar_id":"","url":"https://api.github.com/users/dagnir","html_url":"https://github.com/dagnir","followers_url":"https://api.github.com/users/dagnir/followers","following_url":"https://api.github.com/users/dagnir/following{/other_user}","gists_url":"https://api.github.com/users/dagnir/gists{/gist_id}","starred_url":"https://api.github.com/users/dagnir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagnir/subscriptions","organizations_url":"https://api.github.com/users/dagnir/orgs","repos_url":"https://api.github.com/users/dagnir/repos","events_url":"https://api.github.com/users/dagnir/events{/privacy}","received_events_url":"https://api.github.com/users/dagnir/received_events","type":"User","site_admin":false},"repo":{"id":46747124,"name":"HDANoidTranslation","full_name":"dagnir/HDANoidTranslation","owner":{"login":"dagnir","id":261310,"avatar_url":"https://avatars.githubusercontent.com/u/261310?v=3","gravatar_id":"","url":"https://api.github.com/users/dagnir","html_url":"https://github.com/dagnir","followers_url":"https://api.github.com/users/dagnir/followers","following_url":"https://api.github.com/users/dagnir/following{/other_user}","gists_url":"https://api.github.com/users/dagnir/gists{/gist_id}","starred_url":"https://api.github.com/users/dagnir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagnir/subscriptions","organizations_url":"https://api.github.com/users/dagnir/orgs","repos_url":"https://api.github.com/users/dagnir/repos","events_url":"https://api.github.com/users/dagnir/events{/privacy}","received_events_url":"https://api.github.com/users/dagnir/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dagnir/HDANoidTranslation","description":"Hawaii Digital Archives Noid Translation Rep","fork":true,"url":"https://api.github.com/repos/dagnir/HDANoidTranslation","forks_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/forks","keys_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/teams","hooks_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/hooks","issue_events_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/issues/events{/number}","events_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/events","assignees_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/assignees{/user}","branches_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/branches{/branch}","tags_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/tags","blobs_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/git/refs{/sha}","trees_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/statuses/{sha}","languages_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/languages","stargazers_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/stargazers","contributors_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/contributors","subscribers_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/subscribers","subscription_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/subscription","commits_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/commits{/sha}","git_commits_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/git/commits{/sha}","comments_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/comments{/number}","issue_comment_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/issues/comments{/number}","contents_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/contents/{+path}","compare_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/merges","archive_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/downloads","issues_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/issues{/number}","pulls_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/pulls{/number}","milestones_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/milestones{/number}","notifications_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/labels{/name}","releases_url":"https://api.github.com/repos/dagnir/HDANoidTranslation/releases{/id}","created_at":"2015-11-23T20:48:32Z","updated_at":"2015-10-18T22:05:45Z","pushed_at":"2015-11-23T20:52:20Z","git_url":"git://github.com/dagnir/HDANoidTranslation.git","ssh_url":"git@github.com:dagnir/HDANoidTranslation.git","clone_url":"https://github.com/dagnir/HDANoidTranslation.git","svn_url":"https://github.com/dagnir/HDANoidTranslation","homepage":null,"size":50,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"lelandlopez:master","ref":"master","sha":"1fdf8ecbb47c8e97cd98816ee4cdae7b59817c0c","user":{"login":"lelandlopez","id":2829114,"avatar_url":"https://avatars.githubusercontent.com/u/2829114?v=3","gravatar_id":"","url":"https://api.github.com/users/lelandlopez","html_url":"https://github.com/lelandlopez","followers_url":"https://api.github.com/users/lelandlopez/followers","following_url":"https://api.github.com/users/lelandlopez/following{/other_user}","gists_url":"https://api.github.com/users/lelandlopez/gists{/gist_id}","starred_url":"https://api.github.com/users/lelandlopez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lelandlopez/subscriptions","organizations_url":"https://api.github.com/users/lelandlopez/orgs","repos_url":"https://api.github.com/users/lelandlopez/repos","events_url":"https://api.github.com/users/lelandlopez/events{/privacy}","received_events_url":"https://api.github.com/users/lelandlopez/received_events","type":"User","site_admin":false},"repo":{"id":44498570,"name":"HDANoidTranslation","full_name":"lelandlopez/HDANoidTranslation","owner":{"login":"lelandlopez","id":2829114,"avatar_url":"https://avatars.githubusercontent.com/u/2829114?v=3","gravatar_id":"","url":"https://api.github.com/users/lelandlopez","html_url":"https://github.com/lelandlopez","followers_url":"https://api.github.com/users/lelandlopez/followers","following_url":"https://api.github.com/users/lelandlopez/following{/other_user}","gists_url":"https://api.github.com/users/lelandlopez/gists{/gist_id}","starred_url":"https://api.github.com/users/lelandlopez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lelandlopez/subscriptions","organizations_url":"https://api.github.com/users/lelandlopez/orgs","repos_url":"https://api.github.com/users/lelandlopez/repos","events_url":"https://api.github.com/users/lelandlopez/events{/privacy}","received_events_url":"https://api.github.com/users/lelandlopez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lelandlopez/HDANoidTranslation","description":"Hawaii Digital Archives Noid Translation Rep","fork":false,"url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation","forks_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/forks","keys_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/teams","hooks_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/hooks","issue_events_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/issues/events{/number}","events_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/events","assignees_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/assignees{/user}","branches_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/branches{/branch}","tags_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/tags","blobs_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/git/refs{/sha}","trees_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/statuses/{sha}","languages_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/languages","stargazers_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/stargazers","contributors_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/contributors","subscribers_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/subscribers","subscription_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/subscription","commits_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/commits{/sha}","git_commits_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/git/commits{/sha}","comments_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/comments{/number}","issue_comment_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/issues/comments{/number}","contents_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/contents/{+path}","compare_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/merges","archive_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/downloads","issues_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/issues{/number}","pulls_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/pulls{/number}","milestones_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/milestones{/number}","notifications_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/labels{/name}","releases_url":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/releases{/id}","created_at":"2015-10-18T22:05:45Z","updated_at":"2015-10-18T22:05:45Z","pushed_at":"2015-11-23T20:57:17Z","git_url":"git://github.com/lelandlopez/HDANoidTranslation.git","ssh_url":"git@github.com:lelandlopez/HDANoidTranslation.git","clone_url":"https://github.com/lelandlopez/HDANoidTranslation.git","svn_url":"https://github.com/lelandlopez/HDANoidTranslation","homepage":null,"size":48,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/pulls/3"},"html":{"href":"https://github.com/lelandlopez/HDANoidTranslation/pull/3"},"issue":{"href":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/issues/3"},"comments":{"href":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/lelandlopez/HDANoidTranslation/statuses/7a4368170277129c51d1ffe26a9853718fe4eca6"}}}}