{"action":"created","issue":{"url":"https://api.github.com/repos/mikepenz/MaterialDrawer/issues/868","labels_url":"https://api.github.com/repos/mikepenz/MaterialDrawer/issues/868/labels{/name}","comments_url":"https://api.github.com/repos/mikepenz/MaterialDrawer/issues/868/comments","events_url":"https://api.github.com/repos/mikepenz/MaterialDrawer/issues/868/events","html_url":"https://github.com/mikepenz/MaterialDrawer/issues/868","id":121461635,"number":868,"title":"Add a getItemForTag() for Drawer object","user":{"login":"PsyGik","id":5432911,"avatar_url":"https://avatars.githubusercontent.com/u/5432911?v=3","gravatar_id":"","url":"https://api.github.com/users/PsyGik","html_url":"https://github.com/PsyGik","followers_url":"https://api.github.com/users/PsyGik/followers","following_url":"https://api.github.com/users/PsyGik/following{/other_user}","gists_url":"https://api.github.com/users/PsyGik/gists{/gist_id}","starred_url":"https://api.github.com/users/PsyGik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PsyGik/subscriptions","organizations_url":"https://api.github.com/users/PsyGik/orgs","repos_url":"https://api.github.com/users/PsyGik/repos","events_url":"https://api.github.com/users/PsyGik/events{/privacy}","received_events_url":"https://api.github.com/users/PsyGik/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mikepenz/MaterialDrawer/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"mikepenz","id":1476232,"avatar_url":"https://avatars.githubusercontent.com/u/1476232?v=3","gravatar_id":"","url":"https://api.github.com/users/mikepenz","html_url":"https://github.com/mikepenz","followers_url":"https://api.github.com/users/mikepenz/followers","following_url":"https://api.github.com/users/mikepenz/following{/other_user}","gists_url":"https://api.github.com/users/mikepenz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikepenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikepenz/subscriptions","organizations_url":"https://api.github.com/users/mikepenz/orgs","repos_url":"https://api.github.com/users/mikepenz/repos","events_url":"https://api.github.com/users/mikepenz/events{/privacy}","received_events_url":"https://api.github.com/users/mikepenz/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-12-10T11:18:28Z","updated_at":"2015-12-10T18:20:24Z","closed_at":null,"body":"We have `IDrawerItem<T> getTag();` currently.\r\nIs it possible to have something like `getItemForTag()` to fetch a single drawer item directly using Tag?\r\n\r\nRight now I'm writing code to iterate and get the required item\r\n\r\n```java\r\n     public <T> IDrawerItem getItemForTag(Class<T> tagClass,T tag) {\r\n        for (IDrawerItem item : result.getDrawerItems())\r\n            if (item.getTag() != null && item.getTag().getClass().isAssignableFrom(tagClass))\r\n                if (item.getTag().equals(tag))\r\n                    return item;\r\n        return null;\r\n    }\r\n```\r\nAnd use it like so\r\n```java\r\n    getItemForTag(MyClass.class,objOfMyClass);\r\n```"},"comment":{"url":"https://api.github.com/repos/mikepenz/MaterialDrawer/issues/comments/163708192","html_url":"https://github.com/mikepenz/MaterialDrawer/issues/868#issuecomment-163708192","issue_url":"https://api.github.com/repos/mikepenz/MaterialDrawer/issues/868","id":163708192,"user":{"login":"mikepenz","id":1476232,"avatar_url":"https://avatars.githubusercontent.com/u/1476232?v=3","gravatar_id":"","url":"https://api.github.com/users/mikepenz","html_url":"https://github.com/mikepenz","followers_url":"https://api.github.com/users/mikepenz/followers","following_url":"https://api.github.com/users/mikepenz/following{/other_user}","gists_url":"https://api.github.com/users/mikepenz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikepenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikepenz/subscriptions","organizations_url":"https://api.github.com/users/mikepenz/orgs","repos_url":"https://api.github.com/users/mikepenz/repos","events_url":"https://api.github.com/users/mikepenz/events{/privacy}","received_events_url":"https://api.github.com/users/mikepenz/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T18:20:24Z","updated_at":"2015-12-10T18:20:24Z","body":"@PsyGik what do you need the `tagClass` for? wouldn't it be enough if the `Tag` equals the `item.getTag()`?"}}