Class AbstractHierarchicalIdentifier<T extends AbstractHierarchicalIdentifier<T,I>,I>
java.lang.Object
org.opendaylight.yangtools.concepts.AbstractHierarchicalIdentifier<T,I>
- All Implemented Interfaces:
Serializable
,HierarchicalIdentifier<T>
,Identifier
,Immutable
- Direct Known Subclasses:
YangInstanceIdentifier
public abstract class AbstractHierarchicalIdentifier<T extends AbstractHierarchicalIdentifier<T,I>,I>
extends Object
implements HierarchicalIdentifier<T>
An opinionated superclass for implementing
HierarchicalIdentifier
s.
It assumes that the identifier is composed of multiple non-null steps available via itemIterator()
and that
contains(AbstractHierarchicalIdentifier)
semantics can be implemented using simple in-order comparison of
these steps.
Furthermore it mandates that serialization occurs via writeReplace()
, following the Serialization Proxy
pattern.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
AbstractHierarchicalIdentifier
public AbstractHierarchicalIdentifier()
-
-
Method Details
-
contains
Description copied from interface:HierarchicalIdentifier
Check if this identifier contains some other identifier. If we take HierarchicalIdentifier to be similar to aPath
, this is method is the equivalent ofother.startsWith(this)
.- Specified by:
contains
in interfaceHierarchicalIdentifier<T extends AbstractHierarchicalIdentifier<T,
I>> - Parameters:
other
- Other identifier, may not benull
- Returns:
- True if this identifier contains the other identifier
-
itemIterator
-
writeReplace
- Throws:
ObjectStreamException
-
throwNSE
Utility method throwing aNotSerializableException
. It is useful when implementingreadObject(ObjectInputStream)
,readObjectNoData()
andwriteObject(ObjectOutputStream)
methods, which all subclasses should define as serialization is driven viawriteReplace()
.- Throws:
NotSerializableException
- always
-
hashCode
public abstract int hashCode()- Specified by:
hashCode
in interfaceIdentifier
- Overrides:
hashCode
in classObject
-
equals
- Specified by:
equals
in interfaceIdentifier
- Overrides:
equals
in classObject
-
toString
- Specified by:
toString
in interfaceIdentifier
- Overrides:
toString
in classObject
-