public final class FeedbackMessages extends Object implements IClusterable, Iterable<FeedbackMessage>
WARNING: This class should typically NOT be used directly.
Constructor and Description |
---|
FeedbackMessages()
Construct.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Component reporter,
Serializable message,
int level)
Adds a message
|
void |
add(FeedbackMessage message)
Adds a message.
|
int |
clear()
Clears any existing messages.
|
int |
clear(IFeedbackMessageFilter filter)
Clears all messages that are accepted by the filter.
|
void |
debug(Component reporter,
Serializable message)
Adds a new ui message with level DEBUG to the current messages.
|
void |
detach()
Detaches each stored message
|
void |
error(Component reporter,
Serializable message)
Adds a new ui message with level ERROR to the current messages.
|
void |
fatal(Component reporter,
Serializable message)
Adds a new ui message with level FATAL to the current messages.
|
FeedbackMessage |
first()
Retrieves the first message
|
FeedbackMessage |
first(int level)
Retrieves the first message that level is greater than or equal to the given level
|
boolean |
hasMessage(IFeedbackMessageFilter filter) |
boolean |
hasMessage(int level)
Checks if a message of the specified
level or greater was registered.To check for a precise level use hasMessage(IFeedbackMessageFilter)
and pass it a reference to ExactLevelFeedbackMessageFilter . |
void |
info(Component reporter,
Serializable message)
Adds a new ui message with level INFO to the current messages.
|
boolean |
isEmpty()
Gets whether there are no messages.
|
Iterator<FeedbackMessage> |
iterator()
Gets an iterator over stored messages
|
List<FeedbackMessage> |
messages(IFeedbackMessageFilter filter)
Gets a list of messages from the page using a filter.
|
int |
size()
Gets the number of messages
|
int |
size(IFeedbackMessageFilter filter)
Gets the number of messages.
|
void |
success(Component reporter,
Serializable message)
Adds a new ui message with level SUCCESS to the current messages.
|
List<FeedbackMessage> |
toList()
Retrieves all stored messages as an unmodifiable list
|
String |
toString() |
void |
warn(Component reporter,
Serializable message)
Adds a new ui message with level WARNING to the current messages.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public final void add(FeedbackMessage message)
message
- the messagepublic final void add(Component reporter, Serializable message, int level)
reporter
- message
- level
- public final void debug(Component reporter, Serializable message)
reporter
- the reporting componentmessage
- the actual messagepublic final void info(Component reporter, Serializable message)
reporter
- The reporting componentmessage
- The actual messagepublic final void success(Component reporter, Serializable message)
reporter
- The reporting componentmessage
- The actual messagepublic final void warn(Component reporter, Serializable message)
reporter
- the reporting componentmessage
- the actual messagepublic final void error(Component reporter, Serializable message)
reporter
- the reporting componentmessage
- the actual messagepublic final void fatal(Component reporter, Serializable message)
reporter
- the reporting componentmessage
- the actual messagepublic final int clear()
public final int clear(IFeedbackMessageFilter filter)
filter
- Filter for selecting messages. If null, all messages will be returnedpublic final boolean hasMessage(IFeedbackMessageFilter filter)
filter
- Filter for selecting messagespublic final boolean hasMessage(int level)
level
or greater was registered.level
use hasMessage(IFeedbackMessageFilter)
and pass it a reference to ExactLevelFeedbackMessageFilter
.level
- The level of the messagetrue
if a message with the specified level
or greater was registeredpublic final FeedbackMessage first()
null
if nonepublic final FeedbackMessage first(int level)
level
- The minimum level of the messagenull
if nonepublic final Iterator<FeedbackMessage> iterator()
iterator
in interface Iterable<FeedbackMessage>
public final List<FeedbackMessage> messages(IFeedbackMessageFilter filter)
filter
- Filter for selecting messages. If null, all messages will be returnedpublic final boolean isEmpty()
public final int size()
public final int size(IFeedbackMessageFilter filter)
filter
- Filter for counting messages. If null, the count of all messages will be returnedpublic String toString()
toString
in class Object
Object.toString()
public List<FeedbackMessage> toList()
public void detach()
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.