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

org.fiolino.common.reflection.RegistryMapper 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.MethodHandles;

/**
 * Created by kuli on 10.03.17.
 */
final class RegistryMapper implements LambdaRegistry {
    private final Resettable registry;
    private final T accessor;

    RegistryMapper(Registry registry, Class lambdaType) {
        this.registry = registry;
        MethodHandles.Lookup lookup = MethodHandles.lookup();
        accessor = Methods.lambdafy(lookup, registry.getAccessor(), lambdaType);
    }

    @Override
    public T getAccessor() {
        return accessor;
    }

    @Override
    public void reset() {
        registry.reset();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy