本文整理汇总了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());
}
示例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;
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
}
示例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;
}
}
示例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;
}
}
示例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);
}
示例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;
}
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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;
}
}