当前位置: 首页>>代码示例>>Java>>正文


Java EqualsHelper类代码示例

本文整理汇总了Java中org.alfresco.util.EqualsHelper的典型用法代码示例。如果您正苦于以下问题:Java EqualsHelper类的具体用法?Java EqualsHelper怎么用?Java EqualsHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EqualsHelper类属于org.alfresco.util包,在下文中一共展示了EqualsHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: equals

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
@Override
public boolean equals(Object o)
{
    if (this == o)
    {
        return true;
    }
    if (!(o instanceof AbstractNodePermissionEntry))
    {
        return false;
    }
    AbstractNodePermissionEntry other = (AbstractNodePermissionEntry) o;

    return EqualsHelper.nullSafeEquals(this.getNodeRef(), other.getNodeRef()) &&
           EqualsHelper.nullSafeEquals(this.inheritPermissions(), other.inheritPermissions()) && 
           EqualsHelper.nullSafeEquals(this.getPermissionEntries(), other.getPermissionEntries());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:AbstractNodePermissionEntry.java

示例2: ownerRead

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
protected AccessStatus ownerRead(String username, NodeRef nodeRef)
{
    // Reviewed the behaviour of deny and ownership with Mike F
    // ATM ownership takes precendence over READ deny
    // TODO: check that global owner rights are set
    
    AccessStatus result = AccessStatus.DENIED;

    String owner = ownableService.getOwner(nodeRef);
    if(owner == null)
    {
        // TODO node may not have auditable aspect and hence creator property
        result = AccessStatus.DENIED;
    }

    // is the user the owner of the node?
    if(EqualsHelper.nullSafeEquals(username, owner))
    {
        // ROLE_OWNER authority has FULL_CONTROL in permissionDefinitions
        // so we don't need to check node requirements    		
        return AccessStatus.ALLOWED;
    }

    return result;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:PermissionServiceImpl.java

示例3: equals

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
@Override
public boolean equals(Object o)
{
    if (this == o)
    {
        return true;
    }
    if (!(o instanceof AbstractPermissionEntry))
    {
        return false;
    }
    AbstractPermissionEntry other = (AbstractPermissionEntry) o;
    return EqualsHelper.nullSafeEquals(this.getNodeRef(), other.getNodeRef())
            && EqualsHelper.nullSafeEquals(this.getPermissionReference(), other.getPermissionReference())
            && EqualsHelper.nullSafeEquals(this.getAuthority(), other.getAuthority()) && EqualsHelper.nullSafeEquals(this.getAccessStatus(), other.getAccessStatus());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:AbstractPermissionEntry.java

示例4: onUpdateProperties

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
@Override
public void onUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after)
{
	String uidBefore = DefaultTypeConverter.INSTANCE.convert(String.class, before.get(ContentModel.PROP_USERNAME));
    String uidAfter = DefaultTypeConverter.INSTANCE.convert(String.class, after.get(ContentModel.PROP_USERNAME));
    if (uidBefore != null && !EqualsHelper.nullSafeEquals(uidBefore, uidAfter))
    {
        NodeRef userNode = getUserOrNull(uidBefore);
        if (userNode != null)
        {
            nodeService.setProperty(userNode, ContentModel.PROP_USER_USERNAME, uidAfter);
            nodeService.moveNode(userNode, nodeService.getPrimaryParent(userNode).getParentRef(),
                    ContentModel.ASSOC_CHILDREN, QName.createQName(ContentModel.USER_MODEL_URI, uidAfter));
            removeAuthenticationFromCache(uidBefore);
        }
    }
    removeAuthenticationFromCache(uidAfter);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:RepositoryAuthenticationDao.java

示例5: getSuccessors

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
/**
 * Gets the succeeding versions of a specified version. If there are multiple
 * Versions they are sorted into descending create date order (most recent first).
 * 
 * @param version  the version object
 * @return         a collection containing the succeeding version, empty is none
 */
public Collection<Version> getSuccessors(Version version)
{
    ArrayList<Version> result = new ArrayList<Version>();
    
    if (version != null)
    {
        String versionLabel = version.getVersionLabel();
        
        if (this.versionHistory.containsValue(versionLabel) == true)
        {
            for (Entry<String, Version> entry: versionsByLabel.entrySet())
            {
                String key = entry.getKey();
                if (EqualsHelper.nullSafeEquals(this.versionHistory.get(key), versionLabel))
                {
                    result.add(entry.getValue());
                }
            }
        }
    }

    return sortDescending(result);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:31,代码来源:VersionHistoryImpl.java

示例6: equals

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
/**
 * Compares:
 * <ul>
 * <li>{@link #sourceRef}</li>
 * <li>{@link #targetRef}</li>
 * <li>{@link #assocTypeQName}</li>
 * </ul>
 */
public boolean equals(Object o)
{
    if (this == o)
    {
        return true;
    }
    if (!(o instanceof AssociationRefKey))
    {
        return false;
    }
    AssociationRefKey other = (AssociationRefKey) o;

    return 
            EqualsHelper.nullSafeEquals(this.sourceRef, other.sourceRef)
            && EqualsHelper.nullSafeEquals(this.assocTypeQName, other.assocTypeQName)
            && EqualsHelper.nullSafeEquals(this.targetRef, other.targetRef);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:RepoSecondaryManifestProcessorImpl.java

示例7: getElementQName

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
public String getElementQName(Object o)
{
    QName qName = ((ChildAssociationRef) o).getQName();
    if(qName == null)
    {
        return "";
    }
    String escapedLocalName = ISO9075.encode(qName.getLocalName());
    if (EqualsHelper.nullSafeEquals(escapedLocalName, qName.getLocalName()))        
    {
        return qName.toString();
    }
    else
    {
        return QName.createQName(qName.getNamespaceURI(), escapedLocalName).toString();
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:DocumentNavigator.java

示例8: onUpdateProperties

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
public void onUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after)
{
    Serializable pb = before.get(ContentModel.PROP_OWNER);
    Serializable pa = after.get(ContentModel.PROP_OWNER);

    if (!EqualsHelper.nullSafeEquals(pb, pa))
    {
        nodeOwnerCache.remove(nodeRef);
        return;
    }
    
    pb = before.get(ContentModel.PROP_CREATOR);
    pa = after.get(ContentModel.PROP_CREATOR);

    if (pb != null && !EqualsHelper.nullSafeEquals(pb, pa))
    {
        // A 'null' creator means this is a new node
        nodeOwnerCache.remove(nodeRef);
        return;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:OwnableServiceImpl.java

示例9: equals

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
@Override
public boolean equals(Object obj)
{
    if (this == obj)
    {
        return true;
    }
    else if (obj instanceof UnavailableTransformer)
    {
        UnavailableTransformer that = (UnavailableTransformer) obj;
        return
            EqualsHelper.nullSafeEquals(name, that.name) &&
            maxSourceSizeKBytes == that.maxSourceSizeKBytes;
    }
    else
    {
        return false;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:TransformerDebug.java

示例10: equals

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
public boolean equals(Object obj)
{
    if (obj == this)
    {
        return true;
    }
    if (obj == null)
    {
        return false;
    }
    if (!(obj instanceof TransactionalCache<?, ?>))
    {
        return false;
    }
    @SuppressWarnings("rawtypes")
    TransactionalCache that = (TransactionalCache) obj;
    return EqualsHelper.nullSafeEquals(this.name, that.name);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:TransactionalCache.java

示例11: setChildNameUnique

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
/**
 * Ensures name uniqueness for the child and the child association.  Note that nothing is done if the
 * association type doesn't enforce name uniqueness.
 * 
 * @return          Returns <tt>true</tt> if the child association <b>cm:name</b> was written
 */
private boolean setChildNameUnique(Pair<Long, NodeRef> childNodePair, String newName, String oldName)
{
    if (newName == null)
    {
        newName = childNodePair.getSecond().getId();            // Use the node's GUID
    }
    Long childNodeId = childNodePair.getFirst();
    
    if (EqualsHelper.nullSafeEquals(newName, oldName))
    {
        // The name has not changed
        return false;
    }
    else
    {
        nodeDAO.setChildAssocsUniqueName(childNodeId, newName);
        return true;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:DbNodeServiceImpl.java

示例12: equals

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
/**
 * Compares based on the class of this instance and the incoming instance, before
 * comparing based on all the internal data.  If derived classes store additional
 * data for their functionality, then they should override this.
 */
@Override
public boolean equals(Object obj)
{
    if (obj == null)
        return false;
    else if (this == obj)
        return true;
    else if (this.getClass() != obj.getClass())
        return false;
    // we can safely cast
    AbstractIntegrityEvent that = (AbstractIntegrityEvent) obj;
    return
            EqualsHelper.nullSafeEquals(this.nodeRef, that.nodeRef) &&
            EqualsHelper.nullSafeEquals(this.typeQName, that.typeQName) &&
            EqualsHelper.nullSafeEquals(this.qname, that.qname);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:AbstractIntegrityEvent.java

示例13: equals

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
@Override
public boolean equals(Object obj)
{
    if (this == obj)
    {
        return true;
    }
    else if (obj instanceof AuthorityAliasEntity)
    {
        AuthorityAliasEntity that = (AuthorityAliasEntity)obj;
        return (EqualsHelper.nullSafeEquals(this.id, that.id));
    }
    else
    {
        return false;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:AuthorityAliasEntity.java

示例14: equals

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
@Override
public boolean equals(Object obj)
{
    if (this == obj)
    {
        return true;
    }
    else if (obj instanceof AceEntity)
    {
        AceEntity that = (AceEntity)obj;
        return (EqualsHelper.nullSafeEquals(this.id, that.id));
    }
    else
    {
        return false;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:AceEntity.java

示例15: equals

import org.alfresco.util.EqualsHelper; //导入依赖的package包/类
@Override
public boolean equals(Object obj)
{
    if (this == obj)
    {
        return true;
    }
    else if (obj instanceof PermissionEntity)
    {
        PermissionEntity that = (PermissionEntity)obj;
        return (EqualsHelper.nullSafeEquals(this.typeQnameId, that.typeQnameId) &&
                EqualsHelper.nullSafeEquals(this.name, that.name));
    }
    else
    {
        return false;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:PermissionEntity.java


注:本文中的org.alfresco.util.EqualsHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。