org.xwiki.model.reference
Class PartialEntityReference

java.lang.Object
  extended by org.xwiki.model.reference.EntityReference
      extended by org.xwiki.model.reference.PartialEntityReference
All Implemented Interfaces:
Serializable, Cloneable, Comparable<EntityReference>
Direct Known Subclasses:
RegexEntityReference

public class PartialEntityReference
extends EntityReference

An EntityReference used to match another one.

The PartialEntityReference can be partial or contain holes, for example if only the space regex reference is provided it will tries to match only space part of the provided reference and consider other parts as matched.

It's of course possible to mix regex and "normal" EntityReference member. In that case normal member equals(Object) method behave as usual and then call following member equals(Object) etc.

Since:
5.2M2
Version:
$Id: 680808d104372ef5c9eea89916309e6b5e472b05 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.xwiki.model.reference.EntityReference
TOSTRING_SERIALIZER
 
Constructor Summary
PartialEntityReference(String name, EntityType type)
          Create a new root EntityReference.
PartialEntityReference(String name, EntityType type, EntityReference parent)
          Create a new EntityReference.
 
Method Summary
 boolean equals(Object obj)
          
 int hashCode()
           
protected  boolean isNameEqual(String name)
           
 
Methods inherited from class org.xwiki.model.reference.EntityReference
appendParent, compareTo, extractReference, getName, getParameter, getParent, getReversedReferenceChain, getRoot, getType, removeParent, replaceParent, setName, setParameter, setParameters, setParent, setType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PartialEntityReference

public PartialEntityReference(String name,
                              EntityType type)
Create a new root EntityReference.

Parameters:
name - name for the newly created entity reference, could not be null.
type - type for the newly created entity reference, could not be null.

PartialEntityReference

public PartialEntityReference(String name,
                              EntityType type,
                              EntityReference parent)
Create a new EntityReference.

Parameters:
name - name for the newly created entity reference, could not be null.
type - type for the newly created entity reference, could not be null.
parent - parent reference for the newly created entity reference, may be null.
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class EntityReference

equals

public boolean equals(Object obj)

This equals method actually skip null elements.

Overrides:
equals in class EntityReference
See Also:
EntityReference.equals(java.lang.Object)

isNameEqual

protected boolean isNameEqual(String name)
Parameters:
name - the name to compare to this name
Returns:
true of the passed name is equal to this name


Copyright © 2004–2014 XWiki. All rights reserved.