Example usage for java.lang Class equals

List of usage examples for java.lang Class equals

Introduction

In this page you can find the example usage for java.lang Class equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:org.merka.pentaho.ext.security.ExtensionAuthenticationProvider.java

@Override
public boolean supports(@SuppressWarnings("rawtypes") Class clazz) {
    return clazz.equals(ExtensionAuthenticationToken.class);
}

From source file:com.stratio.decision.shell.converter.ColumnNameTypeConverter.java

@Override
public boolean supports(Class<?> type, String optionContext) {
    if (type.equals(ColumnNameTypeList.class)) {
        return true;
    } else {// w  ww. j a  v a  2 s  .c  o  m
        return false;
    }
}

From source file:com.berkgokden.mongodb.SpringMongoDBConverter.java

public Object toObject(Class clazz, DBObject dbObject) {
    if (clazz.equals(ValueWrapper.class))
        return dbObject.get("value");
    return mongoTemplate.getConverter().read(clazz, dbObject);
}

From source file:org.exoplatform.acceptance.security.CrowdAuthenticationProviderMock.java

/**
 * {@inheritDoc}//from  w ww  .j av a  2  s .c  om
 * Returns <code>true</code> if this <Code>AuthenticationProvider</code> supports the indicated
 * <Code>Authentication</code> object.
 * <p>
 * Returning <code>true</code> does not guarantee an <code>AuthenticationProvider</code> will be able to
 * authenticate the presented instance of the <code>Authentication</code> class. It simply indicates it can support
 * closer evaluation of it. An <code>AuthenticationProvider</code> can still return <code>null</code> from the
 * {@link #authenticate(Authentication)} method to indicate another <code>AuthenticationProvider</code> should be
 * tried.
 * </p>
 * <p>Selection of an <code>AuthenticationProvider</code> capable of performing authentication is
 * conducted at runtime the <code>ProviderManager</code>.</p>
 */
@Override
public boolean supports(Class<?> authentication) {
    return authentication.equals(UsernamePasswordAuthenticationToken.class);
}

From source file:pl.bristleback.server.bristle.conf.resolver.action.ResponseResolver.java

ActionResponseInformation resolveResponse(Method action) {
    ActionResponseInformation responseInformation = new ActionResponseInformation();

    Class<?> actionReturnType = action.getReturnType();
    if (actionReturnType.equals(Void.class) || actionReturnType.equals(Void.TYPE)) {
        responseInformation.setVoidResponse(true);
    }//w  w  w . j  ava 2s .  c  om

    resolveResponseSerialization(action, responseInformation);

    return responseInformation;
}

From source file:com.google.gwt.sample.dynatablemvp.server.loc.SpringServiceLocator.java

@Override
public Object getInstance(Class<?> clazz) {
    final Object bean;
    if (clazz.equals(entityClass)) {
        HttpServletRequest request = RequestFactoryServlet.getThreadLocalRequest();
        ApplicationContext context = WebApplicationContextUtils
                .getWebApplicationContext(request.getSession().getServletContext());
        bean = context.getBean(entityClass);
    } else/*  ww  w  .  ja va  2 s .  com*/
        bean = null;
    return bean;
}

From source file:no.dusken.momus.authentication.TokenAuthenticationProvider.java

@Override
public boolean supports(Class<?> authentication) {
    return authentication.equals(Token.class);
}

From source file:net.gbmb.collector.rest.HttpRecordMessageConverter.java

@Override
public boolean canRead(Class<?> aClass, MediaType mediaType) {
    if (aClass.equals(CollectionRecord.class)) {
        return MediaType.APPLICATION_JSON.includes(mediaType);
    } else {//  w  ww. ja v a 2  s .  com
        return false;
    }
}

From source file:com.springframework.core.annotation.AnnotationUtils.java

/**
 * Find a single {@link Annotation} of {@code annotationType} on the supplied
 * {@link Method}, traversing its super methods (i.e., from superclasses and
 * interfaces) if no annotation can be found on the given method itself.
 * <p>Correctly handles bridge {@link Method Methods} generated by the compiler.
 * <p>Meta-annotations will be searched if the annotation is not
 * <em>directly present</em> on the method.
 * <p>Annotations on methods are not inherited by default, so we need to handle
 * this explicitly.//from   w ww .  j  a  v a2 s .  c  o  m
 * @param method the method to look for annotations on
 * @param annotationType the annotation type to look for
 * @return the matching annotation, or {@code null} if not found
 * @see #getAnnotation(Method, Class)
 */
@SuppressWarnings("unchecked")
public static <A extends Annotation> A findAnnotation(Method method, Class<A> annotationType) {
    AnnotationCacheKey cacheKey = new AnnotationCacheKey(method, annotationType);
    A result = (A) findAnnotationCache.get(cacheKey);

    if (result == null) {
        Method resolvedMethod = BridgeMethodResolver.findBridgedMethod(method);
        result = findAnnotation((AnnotatedElement) resolvedMethod, annotationType);

        if (result == null) {
            result = searchOnInterfaces(method, annotationType, method.getDeclaringClass().getInterfaces());
        }

        Class<?> clazz = method.getDeclaringClass();
        while (result == null) {
            clazz = clazz.getSuperclass();
            if (clazz == null || clazz.equals(Object.class)) {
                break;
            }
            try {
                Method equivalentMethod = clazz.getDeclaredMethod(method.getName(), method.getParameterTypes());
                Method resolvedEquivalentMethod = BridgeMethodResolver.findBridgedMethod(equivalentMethod);
                result = findAnnotation((AnnotatedElement) resolvedEquivalentMethod, annotationType);
            } catch (NoSuchMethodException ex) {
                // No equivalent method found
            }
            if (result == null) {
                result = searchOnInterfaces(method, annotationType, clazz.getInterfaces());
            }
        }

        if (result != null) {
            findAnnotationCache.put(cacheKey, result);
        }
    }

    return result;
}

From source file:cz.zcu.kiv.eegdatabase.logic.controller.person.AddPersonValidator.java

public boolean supports(Class clazz) {
    return clazz.equals(AddPersonCommand.class);
}