Package org.xwiki.model.reference
Class PartialEntityReference
- java.lang.Object
-
- org.xwiki.model.reference.EntityReference
-
- org.xwiki.model.reference.PartialEntityReference
-
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<EntityReference>
- Direct Known Subclasses:
RegexEntityReference
public class PartialEntityReference extends EntityReference
AnEntityReferenceused to match another one.The
PartialEntityReferencecan 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"
EntityReferencemember. In that case normal memberequals(Object)method behave as usual and then call following memberequals(Object)etc.- Since:
- 5.2M2
- Version:
- $Id: c77ff4a314d47034942d6d3451d4fe6e1e872c0d $
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.xwiki.model.reference.EntityReference
TOSTRING_SERIALIZER
-
-
Constructor Summary
Constructors Constructor Description PartialEntityReference(String name, EntityType type)Create a new root EntityReference.PartialEntityReference(String name, EntityType type, EntityReference parent)Create a new EntityReference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)inthashCode()protected booleanisNameEqual(String name)-
Methods inherited from class org.xwiki.model.reference.EntityReference
appendParent, compareTo, equals, equals, equalsNonRecursive, extractFirstReference, extractReference, getName, getParameter, getParameters, getParent, getReversedReferenceChain, getRoot, getType, hasParent, removeParent, replaceParent, replaceParent, setName, setParameter, setParameters, setParent, setType, size, toString
-
-
-
-
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:
hashCodein classEntityReference
-
equals
public boolean equals(Object obj)
This equals method actually skip null elements.
- Overrides:
equalsin classEntityReference- 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
-
-