Example usage for org.springframework.boot.autoconfigure.cache CacheManagerCustomizer getClass

List of usage examples for org.springframework.boot.autoconfigure.cache CacheManagerCustomizer getClass

Introduction

In this page you can find the example usage for org.springframework.boot.autoconfigure.cache CacheManagerCustomizer getClass.

Prototype

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

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.springframework.boot.autoconfigure.cache.CacheManagerCustomizers.java

/**
 * Customize the specified {@link CacheManager}. Locates all
 * {@link CacheManagerCustomizer} beans able to handle the specified instance and
 * invoke {@link CacheManagerCustomizer#customize(CacheManager)} on them.
 * @param <T> the type of cache manager
 * @param cacheManager the cache manager to customize
 * @return the cache manager//ww w  .  j av a 2s.c  om
 */
public <T extends CacheManager> T customize(T cacheManager) {
    for (CacheManagerCustomizer<?> customizer : this.customizers) {
        Class<?> generic = ResolvableType.forClass(CacheManagerCustomizer.class, customizer.getClass())
                .resolveGeneric();
        if (generic.isInstance(cacheManager)) {
            customize(cacheManager, customizer);
        }
    }
    return cacheManager;
}