Interface DataObjectReference<T extends DataObject>

Type Parameters:
T - type of DataObject held in the last step.
All Superinterfaces:
Immutable, Serializable
All Known Subinterfaces:
DataObjectIdentifier<T>, DataObjectIdentifier.WithKey<T,K>, DataObjectReference.WithKey<T,K>
All Known Implementing Classes:
AbstractDataObjectReference, DataObjectIdentifierImpl, DataObjectIdentifierWithKey, DataObjectReferenceImpl, DataObjectReferenceWithKey, InstanceIdentifier, KeyedInstanceIdentifier

public sealed interface DataObjectReference<T extends DataObject> extends Immutable, Serializable permits DataObjectIdentifier<T>, DataObjectReference.WithKey<T,K>, AbstractDataObjectReference<T,S>
A reference to a DataObject with semantics partially overlapping with to YANG instance-identifier.

While this indirection is not something defined in YANG, this class hierarchy arises naturally from the Binding specification's Java footprint, which uses DataObject as the baseline self-sufficient addressable construct. This means users can use a KeyAware class without specifying the corresponding key -- resulting in an InexactDataObjectStep.

There are two kinds of a reference based on their treatment of such a InexactDataObjectStep:

  1. DataObjectIdentifier, which accepts only ExactDataObjectSteps and represents a BindingInstanceIdentifier pointing to a DataObject
  2. DataObjectReference, which accepts any DataObjectStep and represents path-based matching criteria for one or more DataObjectIdentifiers based on InexactDataObjectStep.matches(DataObjectStep).
An explicit conversion to DataObjectIdentifier can be attempted via toIdentifier() method.

The legacy InstanceIdentifier is implements the second kind via its class hierarchy, but indicates its compliance via isExact() method. Any DataObjectReference can be converted into an InstanceIdentifier via the toLegacy() method.