Example usage for java.lang Object equals

List of usage examples for java.lang Object equals

Introduction

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

Prototype

public boolean equals(Object obj) 

Source Link

Document

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

Usage

From source file:com.flipkart.flux.type.SetJsonType.java

@Override
public boolean equals(Object x, Object y) throws HibernateException {
    if (x == null) {
        return (y == null);
    }// w  w  w.  j av a2s  .  c  o m

    return x.equals(y);
}

From source file:it.unibas.spicygui.controllo.mapping.ActionTranslate.java

public void update(Observable o, Object stato) {
    if (stato.equals(LastActionBean.SOLVE)) {
        this.setEnabled(true);
    } else {/*from   www.  j av a 2s.  c o  m*/
        this.setEnabled(false);
    }
}

From source file:com.openedit.users.BaseGroup.java

public void removePermission(String inPermission) throws UserManagerException {
    for (Iterator iterator = getPermissions().iterator(); iterator.hasNext();) {
        Object existingpermission = (Object) iterator.next();
        if (existingpermission.equals(inPermission)) {
            getPermissions().remove(existingpermission);
            break;
        }/*  w  w  w.  j  av a 2s  .c  o  m*/
    }

}

From source file:com.openedit.users.BaseGroup.java

public boolean hasPermission(String inPermission) {
    for (Iterator iterator = getPermissions().iterator(); iterator.hasNext();) {
        Object existingpermission = (Object) iterator.next();
        if (existingpermission.equals(inPermission)) {
            return true;
        }//from  w w w. ja v a  2s.  c  om
    }
    String ok = getPropertyContainer().getString(inPermission);

    if (Boolean.parseBoolean(ok)) {
        return true;
    }
    return false;
}

From source file:com.wickettraining.modelproxy.ProxyManager.java

public final <T> T proxy(T object) {
    final String uniqueID = createUniqueID(object);
    Object replaced = targets.put(uniqueID, object);
    if (replaced != null) {
        logger.warn(// w  w  w  . j a v  a  2 s . c  om
                "WARNING: you replaced one object with another in the proxy manager.  this was most likely a mistake.  you should make sure that you are truly generating a unique ID for each object");
    }
    ObjectLocator locator = new ObjectLocator() {
        private static final long serialVersionUID = 1L;

        public Object getObject() {
            return targets.get(uniqueID);
        }

        public boolean appliesTo(Object obj) {
            return obj.equals(getObject());
        }
    };

    return proxy(object, locator);
}

From source file:com.lexicalscope.javabeanhelpers.generator.plugin.JavaBeanHelpersGeneratorMojo.java

private ClassLoader getClassLoader() throws MalformedURLException, DependencyResolutionRequiredException {
    synchronized (JavaBeanHelpersGeneratorMojo.class) {
        if (classLoader == null) {
            final List<URL> urls = new ArrayList<URL>();
            for (final Object object : project.getCompileClasspathElements()) {
                if (!object.equals(project.getBuild().getOutputDirectory())) {
                    final String path = (String) object;
                    urls.add(new File(path).toURI().toURL());
                }/*from   ww w .ja v  a  2s  .  co m*/
            }
            classLoader = new URLClassLoader(urls.toArray(new URL[] {}));
        }
        return classLoader;
    }
}

From source file:com.baomidou.framework.aop.ResubmitAspect.java

/**
 * <p>//www. j  a va  2 s.  com
 * ?? token
 * </p>
 * <p>
 * ????token<br>
 * ????
 * </p>
 */
public void validation(ProceedingJoinPoint joinPoint, HttpServletRequest request, HttpSession session,
        String tokenFlag) throws Throwable {
    Object sessionFlag = session.getAttribute(tokenFlag);
    Object requestFlag = request.getParameter(PARAM_TOKEN);
    if (sessionFlag != null && sessionFlag.equals(requestFlag)) {
        session.removeAttribute(tokenFlag);
        joinPoint.proceed();
    }
}

From source file:com.goodhuddle.huddle.repository.PageContentUserType.java

@Override
public boolean equals(Object x, Object y) throws HibernateException {
    if (x == null) {
        return (y != null);
    }/*from  w w  w.  j a  va2s  .c  o m*/
    return (x.equals(y));
}

From source file:fitnesse.wiki.WikiPagePath.java

public boolean startsWith(WikiPagePath that) {
    if (that.names.size() > names.size())
        return false;

    Iterator<String> thisIterator = names.iterator();
    for (String name : that.names) {
        Object thisNext = thisIterator.next();
        if (!thisNext.equals(name))
            return false;
    }/*from  w w w. j a  v  a  2  s  .  c  om*/
    return true;
}

From source file:info.magnolia.ui.vaadin.grid.MagnoliaTreeTable.java

/**
 * @return <code>true</code> if itemId is a descendant of parentId, <code>false</code> otherwise.
 *//*from ww w .jav  a 2s  . com*/
public boolean isDescendantOf(final Object itemId, final Object parentId) {
    Hierarchical container = getContainerDataSource();
    Object id = itemId;
    while (!container.isRoot(id)) {
        id = container.getParent(id);
        if (id.equals(parentId)) {
            return true;
        }
    }
    return false;
}