public abstract class MessageAggregatorImpl<T> extends java.lang.Object implements MessageAggregator<T>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
appendAtTheEnd |
protected int |
messageCount |
protected java.util.List<T> |
messageList |
protected T |
separator |
| Constructor and Description |
|---|
MessageAggregatorImpl(T separator, boolean appendAtTheEnd) |
| Modifier and Type | Method and Description |
|---|---|
int |
addMessage(T message)
Appends the separator and the message to the list.
|
protected abstract T |
aggregate()
When non-empty, defines how the entire list of Ts gets aggregated into one T.
|
T |
getAggregatedMessage()
Get the whole aggregated message.
|
int |
getMessageCount()
Getter for the message count.
|
T |
getSeparator()
Getter for the
separator property. |
boolean |
isAppendAtTheEnd()
Getter for the
appendAtTheEnd property. |
protected T separator
protected boolean appendAtTheEnd
protected java.util.List<T> messageList
protected int messageCount
public MessageAggregatorImpl(T separator, boolean appendAtTheEnd)
public int addMessage(T message)
MessageAggregatoraddMessage in interface MessageAggregator<T>message - the message to add.public T getAggregatedMessage()
MessageAggregatorgetAggregatedMessage in interface MessageAggregator<T>public boolean isAppendAtTheEnd()
MessageAggregatorappendAtTheEnd property.isAppendAtTheEnd in interface MessageAggregator<T>appendAtTheEnd property.public int getMessageCount()
MessageAggregatorgetMessageCount in interface MessageAggregator<T>public T getSeparator()
MessageAggregatorseparator property.getSeparator in interface MessageAggregator<T>protected abstract T aggregate()