Interface OpaqueObject<T extends OpaqueObject<T>>
-
- Type Parameters:
T
- Generated interface
- All Superinterfaces:
BindingObject
,DataContainer
,ValueAware<OpaqueData<?>>
- All Known Implementing Classes:
AbstractOpaqueObject
,CodecOpaqueObject
@Beta public interface OpaqueObject<T extends OpaqueObject<T>> extends BindingObject, DataContainer, ValueAware<OpaqueData<?>>
An opaque object. This interface supports code generation for bothanyxml
andanydata
. Both of these statements essentially share the same characteristic of storing data whose actual schema and representation is not known at compile-time. Schema may be unknown even at runtime, and furthermore the representation may vary during run-time, based on source of the data.The code generation is therefore limited to a single interface, which only provides the default implementation of
implementedInterface()
bound to itself. The value is communicated throughValueAware.getValue()
, which is only an encapsulation holding information about the object model and the data in that object model.Implementations are strongly encouraged to use
AbstractOpaqueObject
as their base implementation class.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
equals(Object obj)
Compare this object to another object.int
hashCode()
Hash code value of this object.Class<T>
implementedInterface()
Return the interface implemented by this object.-
Methods inherited from interface org.opendaylight.yangtools.yang.binding.ValueAware
getValue
-
-
-
-
Method Detail
-
implementedInterface
Class<T> implementedInterface()
Description copied from interface:DataContainer
Return the interface implemented by this object. This method differs fromObject.getClass()
in that it returns the interface contract, not a concrete implementation class.- Specified by:
implementedInterface
in interfaceDataContainer
- Returns:
- Implemented contract
-
hashCode
int hashCode()
Hash code value of this object. This is a combination ofimplementedInterface()
and the value being held. The canonical computation algorithm is defined inAbstractOpaqueObject.hashCode()
.
-
equals
boolean equals(Object obj)
Compare this object to another object. The comparison needs to take into accountimplementedInterface()
first and then follow comparison onValueAware.getValue()
. For canonical algorithm please refer toAbstractOpaqueObject.equals(Object)
.
-
-