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

org.jruby.util.collections.Java7ClassValue Maven / Gradle / Ivy

There is a newer version: 9.4.9.0
Show newest version
package org.jruby.util.collections;

/**
 * A proxy cache that uses Java 7's ClassValue.
 */
public class Java7ClassValue extends ClassValue {

    public Java7ClassValue(ClassValueCalculator calculator) {
        super(calculator);
    }

    public T get(Class cls) {
        return proxy.get(cls);
    }

    private final java.lang.ClassValue proxy = new java.lang.ClassValue() {
        @Override
        protected T computeValue(Class type) {
            return calculator.computeValue(type);
        }
    };
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy