Example usage for com.google.common.cache CacheLoader getClass

List of usage examples for com.google.common.cache CacheLoader getClass

Introduction

In this page you can find the example usage for com.google.common.cache CacheLoader getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.github.benmanes.caffeine.guava.CaffeinatedGuava.java

static boolean hasMethod(CacheLoader<?, ?> cacheLoader, String name, Class<?>... paramTypes) {
    try {//  w  w w  .  j a va2 s.c  om
        Method method = cacheLoader.getClass().getMethod(name, paramTypes);
        return (method.getDeclaringClass() != CacheLoader.class);
    } catch (NoSuchMethodException | SecurityException e) {
        return false;
    }
}