Class LambdaUtil


  • public final class LambdaUtil
    extends java.lang.Object
    Utility class for lambda support.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Message get​(MessageSupplier supplier)
      Returns the Message supplied by the specified function.
      static java.lang.Object get​(Supplier<?> supplier)
      Returns the result of evaluating the specified function.
      static java.lang.Object[] getAll​(Supplier<?>... suppliers)
      Converts an array of lambda expressions into an array of their evaluation results.
      static Message getMessage​(Supplier<?> supplier, MessageFactory messageFactory)
      Returns a Message, either the value supplied by the specified function, or a new Message created by the specified Factory.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getAll

        public static java.lang.Object[] getAll​(Supplier<?>... suppliers)
        Converts an array of lambda expressions into an array of their evaluation results.
        Parameters:
        suppliers - an array of lambda expressions or null
        Returns:
        an array containing the results of evaluating the lambda expressions (or null if the suppliers array was null
      • get

        public static java.lang.Object get​(Supplier<?> supplier)
        Returns the result of evaluating the specified function. If the supplied value is of type Message, this method returns the result of calling #getFormattedMessage on that Message.
        Parameters:
        supplier - a lambda expression or null
        Returns:
        the results of evaluating the lambda expression (or null if the supplier was null
      • get

        public static Message get​(MessageSupplier supplier)
        Returns the Message supplied by the specified function.
        Parameters:
        supplier - a lambda expression or null
        Returns:
        the Message resulting from evaluating the lambda expression (or null if the supplier was null
      • getMessage

        public static Message getMessage​(Supplier<?> supplier,
                                         MessageFactory messageFactory)
        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 or null
        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