Package org.faktorips.runtime
Class MessageLists
java.lang.Object
org.faktorips.runtime.MessageLists
Utility class for handling
MessageList objects.-
Method Summary
Modifier and TypeMethodDescriptionstatic final Collector<Message,?, MessageList> static final MessageListReturns a new emptyMessageList.static final MessageListfiltered(MessageList ml, Predicate<Message> predicate) Returns a newMessageListthat contains all messages from the given list that satisfy the given predicate.static final Collector<MessageList,?, MessageList> flatten()static final MessageListjoin(MessageList... messageLists) Returns a newMessageListthat combines the messages of the givenMessageListsincluding duplicates.static final MessageListReturns the givenMessageListif it is notnullor a new emptyMessageListif it is.static final MessageListsortBySeverity(MessageList unsortedMessageList) Returns a newMessageListcontaining the same messages as the given list, sorted by descendingSeverity.
-
Method Details
-
emptyMessageList
Returns a new emptyMessageList.- Returns:
- a new empty
MessageList
-
orEmptyMessageList
Returns the givenMessageListif it is notnullor a new emptyMessageListif it is.- Parameters:
ml- aMessageList, may benull- Returns:
- the given
MessageListif it is notnullor a new emptyMessageListif it is
-
sortBySeverity
Returns a newMessageListcontaining the same messages as the given list, sorted by descendingSeverity. Within each severity the previous order is preserved. Returns an emptyMessageListifnullis given.- Parameters:
unsortedMessageList- aMessageListthat may benull- Returns:
- a new
MessageListcontaining the same messages as the given list, sorted by descendingSeverity
-
filtered
Returns a newMessageListthat contains all messages from the given list that satisfy the given predicate. Returns an emptyMessageListifnullis given.- Parameters:
ml- aMessageListthat may benullpredicate- a predicate to filter messages with- Returns:
- a new
MessageListall messages from the given list that satisfy the given predicate
-
flatten
- Returns:
- a
Collectorthat collectsMessageListsinto a newMessageList
-
collectMessages
Returns aCollectorthat can be used to collect messages from aStreamofMessagesinto aMessageList.- Returns:
- a
Collectorthat collects messages into aMessageList
-
join
Returns a newMessageListthat combines the messages of the givenMessageListsincluding duplicates. Returns an emptyMessageListifnullis given.- Parameters:
messageLists- theMessageListsthat the newMessageListwill join. May benull- Returns:
- a new
MessageListthat contains all messages of the givenMessageLists
-