Check if a message has already been logged or shown. This does not log or show anything but only stores the message as one that has been shown already if necessary and returns if the message has been shown or not. @param message - the message that should only be logged or shown once @return - true
(String message)
| 824 | * |
| 825 | */ |
| 826 | public static boolean isLoggedOnce(String message) { |
| 827 | boolean isThere = alreadyLoggedMessages.contains(message); |
| 828 | if(!isThere) { |
| 829 | alreadyLoggedMessages.add(message); |
| 830 | } |
| 831 | return isThere; |
| 832 | } |
| 833 | |
| 834 | private static final Set<String> alreadyLoggedMessages = |
| 835 | Collections.synchronizedSet(new HashSet<String>()); |