All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fiolino.common.reflection.Cache Maven / Gradle / Ivy

Go to download

General structure to easily create dynamic logic via MethodHandles and others.

There is a newer version: 1.0.10
Show newest version
package org.fiolino.common.reflection;

import java.lang.invoke.CallSite;
import java.lang.invoke.MethodHandle;

/**
 * A cache is a Registry that can be used as an initializer in an #invokedymnamic call.
 *
 * Created by kuli on 12.07.17.
 */
public interface Cache extends Registry {
    /**
     * Gets the {@link CallSite} that is used to fetch the accessor handle.
     */
    CallSite getCallSite();

    default MethodHandle getAccessor() {
        return getCallSite().dynamicInvoker();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy