Class AdaptedFunctionReference

  • All Implemented Interfaces:
    java.io.Serializable, kotlin.Function, kotlin.jvm.internal.FunctionBase

    @SinceKotlin(version="1.4")
    public class AdaptedFunctionReference
    extends java.lang.Object
    implements kotlin.jvm.internal.FunctionBase, java.io.Serializable
    Superclass for instances of adapted function references, i.e. references where expected function type differs from the target function signature:
         fun target(s: String? = ""): String = s!!
         fun use(f: () -> Unit) {}
         use(::target)  // adapted function reference (default argument conversion + coercion to Unit)
     
    It doesn't inherit from FunctionReference because such references don't support reflection yet. Once this changes in the future, the JVM codegen may simply use FunctionReferenceImpl for adapted function references instead of this class.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Object receiver  
    • Constructor Summary

      Constructors 
      Constructor Description
      AdaptedFunctionReference​(int arity, java.lang.Class owner, java.lang.String name, java.lang.String signature, int flags)  
      AdaptedFunctionReference​(int arity, java.lang.Object receiver, java.lang.Class owner, java.lang.String name, java.lang.String signature, int flags)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int getArity()  
      kotlin.reflect.KDeclarationContainer getOwner()  
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • receiver

        protected final java.lang.Object receiver
    • Constructor Detail

      • AdaptedFunctionReference

        public AdaptedFunctionReference​(int arity,
                                        java.lang.Class owner,
                                        java.lang.String name,
                                        java.lang.String signature,
                                        int flags)
      • AdaptedFunctionReference

        public AdaptedFunctionReference​(int arity,
                                        java.lang.Object receiver,
                                        java.lang.Class owner,
                                        java.lang.String name,
                                        java.lang.String signature,
                                        int flags)
    • Method Detail

      • getArity

        public int getArity()
        Specified by:
        getArity in interface kotlin.jvm.internal.FunctionBase
      • getOwner

        public kotlin.reflect.KDeclarationContainer getOwner()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object