Example usage for com.google.common.base Supplier getClass

List of usage examples for com.google.common.base Supplier getClass

Introduction

In this page you can find the example usage for com.google.common.base Supplier getClass.

Prototype

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

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:se.softhouse.common.guavaextensions.Suppliers2.java

/**
 * Returns true if {@code Supplier} is likely to supply values very fast
 *//*from  ww w .j a va  2  s  .co m*/
public static boolean isSuppliedAlready(Supplier<?> supplier) {
    if (supplier.getClass().equals(OF_INSTANCE))
        return true;
    else if (supplier instanceof ListSupplier<?>) {
        ListSupplier<?> listSupplier = (ListSupplier<?>) supplier;
        if (listSupplier.elementSupplier.getClass().equals(OF_INSTANCE))
            return true;
    }
    return false;
}