Browse Source

Add a method to get all info in UserInfoEvent.

pull/85/head
Greg Holmes 9 years ago
parent
commit
a2fb89a5c3
1 changed files with 10 additions and 0 deletions
  1. 10
    0
      common/src/com/dmdirc/parser/events/UserInfoEvent.java

+ 10
- 0
common/src/com/dmdirc/parser/events/UserInfoEvent.java View File

@@ -25,6 +25,7 @@ package com.dmdirc.parser.events;
25 25
 import com.dmdirc.parser.interfaces.ClientInfo;
26 26
 import com.dmdirc.parser.interfaces.Parser;
27 27
 
28
+import java.util.Collections;
28 29
 import java.util.Date;
29 30
 import java.util.EnumMap;
30 31
 import java.util.Map;
@@ -64,6 +65,15 @@ public class UserInfoEvent extends ParserEvent {
64 65
         return Optional.ofNullable(info.get(type));
65 66
     }
66 67
 
68
+    /**
69
+     * Gets all the pieces of information about the user.
70
+     *
71
+     * @return Map of all information about a user, may be empty
72
+     */
73
+    public Map<UserInfoType, String> getInfo() {
74
+        return Collections.unmodifiableMap(info);
75
+    }
76
+
67 77
     /**
68 78
      * The types of user info that may be returned by the server.
69 79
      */

Loading…
Cancel
Save