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.mitre.openid.connect.view.ClientEntityViewForAdmins.java

/**
 * @return//from  w w w  .j a v a 2 s . co  m
 */
@Override
protected ExclusionStrategy getExclusionStrategy() {
    return new ExclusionStrategy() {

        @Override
        public boolean shouldSkipField(FieldAttributes f) {
            if (blacklistedFields.contains(f.getName())) {
                return true;
            } else {
                return false;
            }
        }

        @Override
        public boolean shouldSkipClass(Class<?> clazz) {
            // skip the JPA binding wrapper
            if (clazz.equals(BeanPropertyBindingResult.class)) {
                return true;
            }
            return false;
        }

    };
}

From source file:eu.eubrazilcc.lvl.core.xml.ESearchXmlBinder.java

@Override
@SuppressWarnings("unchecked")
protected <T> JAXBElement<T> createType(final T obj) {
    Object element = null;/* w  ww.j a  v  a  2  s .co m*/
    Class<? extends Object> clazz = obj.getClass();
    if (clazz.equals(ESearchResult.class)) {
        element = ESEARCH_XML_FACTORY.createESearchResult();
    } else {
        throw new IllegalArgumentException("Unsupported type: " + clazz.getCanonicalName());
    }
    return (JAXBElement<T>) element;
}

From source file:org.springframework.data.rest.webmvc.alps.AlpsJsonHttpMessageConverter.java

@Override
public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType) {
    return converterType.equals(AlpsJsonHttpMessageConverter.class);
}

From source file:com.khubla.cbean.serializer.impl.SimpleFieldSerializer.java

@Override
public boolean applies(Field field) {
    final Class<?> clazz = field.getType();
    return isWrapperType(clazz) || clazz.isPrimitive() || clazz.equals(String.class);
}

From source file:org.mitre.openid.connect.view.ClientEntityViewForUsers.java

@Override
protected ExclusionStrategy getExclusionStrategy() {
    return new ExclusionStrategy() {

        @Override/* www .ja v a2s . co m*/
        public boolean shouldSkipField(FieldAttributes f) {
            // whitelist the handful of fields that are good
            if (whitelistedFields.contains(f.getName())) {
                return false;
            } else {
                return true;
            }
        }

        @Override
        public boolean shouldSkipClass(Class<?> clazz) {
            // skip the JPA binding wrapper
            if (clazz.equals(BeanPropertyBindingResult.class)) {
                return true;
            }
            return false;
        }

    };
}

From source file:com.blackducksoftware.tools.appedit.web.auth.AppEditAuthenticationProvider.java

/**
 * Returns true when asked if UsernamePassword authentication method is
 * supported, false otherwise./*  w  ww.ja  va2s  .  c  o  m*/
 *
 * @param authentication
 * @return
 */
@Override
public boolean supports(Class<? extends Object> authentication) {
    return authentication.equals(UsernamePasswordAuthenticationToken.class);
}

From source file:io.leishvl.core.xml.PubMedXmlBinder.java

@Override
@SuppressWarnings("unchecked")
protected <T> JAXBElement<T> createType(final T obj) {
    Object element;//  w  w w  .  j av  a2  s.c  om
    Class<?> clazz = obj.getClass();
    if (clazz.equals(PubmedArticleSet.class)) {
        element = PUBMED_XML_FACTORY.createPubmedArticleSet();
    } else if (clazz.equals(PubmedArticle.class)) {
        element = PUBMED_XML_FACTORY.createPubmedArticle();
    } else {
        throw new IllegalArgumentException("Unsupported type: " + clazz.getCanonicalName());
    }
    return (JAXBElement<T>) element;
}

From source file:com.apress.progwt.server.web.domain.validation.CreateUserRequestValidator.java

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

From source file:io.yields.math.framework.property.SortedProperty.java

protected SortedProperty(boolean increasing, Class<T> clazz, String explanation) {
    this.increasing = increasing;
    if (clazz.equals(Double.class) || clazz.equals(double.class)) {
        this.comparator = new Comparator<T>() {
            @Override//from   w w  w.  j  a  v  a2  s .co  m
            public int compare(T o1, T o2) {
                return compareDouble(o1, o2);
            }
        };
    } else {
        this.comparator = new Comparator<T>() {
            @Override
            public int compare(T o1, T o2) {
                return o1.compareTo(o2);
            }
        };
    }
    this.explanation = explanation;
}

From source file:com.bstek.dorado.idesupport.RuleTemplateManager.java

public RuleTemplate getRuleTemplate(Class<?> type) throws ClassNotFoundException {
    for (RuleTemplate ruleTemplate : ruleTemplateMap.values()) {
        if (StringUtils.isNotEmpty(ruleTemplate.getType())) {
            Class<?> ruleType = ClassUtils.forName(ruleTemplate.getType());
            if (ruleType.equals(type)) {
                return ruleTemplate;
            }//from  w w w.  ja  v a 2 s  . c  om
        }
    }
    return null;
}