Class LambdaUtils


  • public final class LambdaUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object getTarget​(java.lang.invoke.SerializedLambda l)
      Get target of the method reference that was converted to a lambda.
      static java.lang.invoke.SerializedLambda toSerializedLambda​(java.lang.Object lambda)
      Unfortunate sorcery to reflect on lambda.
      • Methods inherited from class java.lang.Object

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

      • getTarget

        public static java.lang.Object getTarget​(java.lang.invoke.SerializedLambda l)
        Get target of the method reference that was converted to a lambda.
        Parameters:
        l - lambda expression that could be a method reference.
        Returns:
        either target of the method reference or null if it is not reference in form object::method.
      • toSerializedLambda

        public static java.lang.invoke.SerializedLambda toSerializedLambda​(java.lang.Object lambda)
        Unfortunate sorcery to reflect on lambda. Works only if function that lambda implements is serializable. This is why Functions is needed as all its functions are serializable.
        Parameters:
        lambda - lambda that potentially implements Serializable.
        Returns:
        lambda in SerializedLambda form or null if its function doesn't implement Serializable.