Class AbstractOpaqueObject<T extends OpaqueObject<T>>
java.lang.Object
org.opendaylight.yangtools.binding.lib.AbstractOpaqueObject<T>
- Type Parameters:
T
- Implemented OpaqueObject type
- All Implemented Interfaces:
BindingContract<OpaqueObject<T>>
,BindingObject
,OpaqueObject<T>
,ValueAware<OpaqueData<?>>
- Direct Known Subclasses:
CodecOpaqueObject
@Beta
public abstract class AbstractOpaqueObject<T extends OpaqueObject<T>>
extends Object
implements OpaqueObject<T>
Utility base class for
OpaqueObject
implementations. This class provides baseline implementation of
hashCode()
and equals(Object)
as specified by OpaqueObject
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MoreObjects.ToStringHelper
final boolean
Compare this object to another object.final int
hashCode()
Hash code value of this object.final String
toString()
protected boolean
valueEquals
(@NonNull OpaqueData<?> otherValue) protected int
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opendaylight.yangtools.binding.OpaqueObject
implementedInterface
Methods inherited from interface org.opendaylight.yangtools.binding.ValueAware
getValue
-
Constructor Details
-
AbstractOpaqueObject
public AbstractOpaqueObject()
-
-
Method Details
-
hashCode
public final int hashCode()Description copied from interface:OpaqueObject
Hash code value of this object. This is a combination ofOpaqueObject.implementedInterface()
and the value being held. The canonical computation algorithm is defined inhashCode()
.- Specified by:
hashCode
in interfaceOpaqueObject<T extends OpaqueObject<T>>
- Overrides:
hashCode
in classObject
- Returns:
- a hash code value for this object.
-
equals
Description copied from interface:OpaqueObject
Compare this object to another object. The comparison needs to take into accountOpaqueObject.implementedInterface()
first and then follow comparison onValueAware.getValue()
. For canonical algorithm please refer toequals(Object)
.- Specified by:
equals
in interfaceOpaqueObject<T extends OpaqueObject<T>>
- Overrides:
equals
in classObject
- Parameters:
obj
- the reference object with which to compare.- Returns:
true
if this object is the same as the obj argument;false
otherwise.
-
toString
-
addToStringAttributes
-
valueEquals
-
valueHashCode
protected int valueHashCode()
-