Example usage for javax.annotation Resource getClass

List of usage examples for javax.annotation Resource getClass

Introduction

In this page you can find the example usage for javax.annotation Resource getClass.

Prototype

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

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.cloudbees.clickstack.domain.metadata.Metadata.java

@Nonnull
public <R extends Resource> Collection<R> getResources(@Nullable final Class<R> type) {
    if (type == null)
        return (Collection<R>) resources.values();

    return (Collection<R>) Collections2.filter(resources.values(), new Predicate<Resource>() {
        @Override/*from ww w .j a  v  a2s. co m*/
        public boolean apply(@Nullable Resource r) {
            return type.isAssignableFrom(r.getClass());
        }
    });
}