Package org.apache.logging.log4j.util
Class LambdaUtil
java.lang.Object
org.apache.logging.log4j.util.LambdaUtil
Utility class for lambda support.
- Since:
- 2.4
-
Method Summary
Modifier and TypeMethodDescriptionstatic Messageget(MessageSupplier supplier) Returns the Message supplied by the specified function.static ObjectReturns the result of evaluating the specified function.static Object[]Converts an array of lambda expressions into an array of their evaluation results.static MessagegetMessage(Supplier<?> supplier, MessageFactory messageFactory) Returns a Message, either the value supplied by the specified function, or a new Message created by the specified Factory.
-
Method Details
-
getAll
Converts an array of lambda expressions into an array of their evaluation results.- Parameters:
suppliers- an array of lambda expressions ornull- Returns:
- an array containing the results of evaluating the lambda expressions (or
nullif the suppliers array wasnull
-
get
Returns the result of evaluating the specified function. If the supplied value is of type Message, this method returns the result of calling#getFormattedMessageon that Message.- Parameters:
supplier- a lambda expression ornull- Returns:
- the results of evaluating the lambda expression (or
nullif the supplier wasnull
-
get
Returns the Message supplied by the specified function.- Parameters:
supplier- a lambda expression ornull- Returns:
- the Message resulting from evaluating the lambda expression (or
nullif the supplier wasnull
-
getMessage
Returns a Message, either the value supplied by the specified function, or a new Message created by the specified Factory.- Parameters:
supplier- a lambda expression ornull- Returns:
- the Message resulting from evaluating the lambda expression or the Message created by the factory for supplied values that are not of type Message
- Since:
- 2.6
-