Просмотр исходного кода

Merge pull request #85 from greboid/dev

Add a method to get all info in UserInfoEvent.
pull/86/head
Chris Smith 9 лет назад
Родитель
Сommit
e94cdf4a8c
1 измененных файлов: 10 добавлений и 0 удалений
  1. 10
    0
      common/src/com/dmdirc/parser/events/UserInfoEvent.java

+ 10
- 0
common/src/com/dmdirc/parser/events/UserInfoEvent.java Просмотреть файл

@@ -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
      */

Загрузка…
Отмена
Сохранить