Bug 1385 : Adding support for toString, equals and hashCode for the Typed Interfaces. 37/9237/2
authorMadhu Venugopal <mavenugo@gmail.com>
Tue, 22 Jul 2014 14:10:18 +0000 (07:10 -0700)
committerMadhu Venugopal <mavenugo@gmail.com>
Tue, 22 Jul 2014 20:42:15 +0000 (13:42 -0700)
commit7f694b634916401199e4ee1df7b9feb029e3bfe1
treeaa2730c7d7f60017f4d7065d18006f2a32fab3bd
parent551f053cc7d1fddf6d88a50cc236bd2a6b18c9e8
Bug 1385 : Adding support for toString, equals and hashCode for the Typed Interfaces.

Guava's AbstractInvocationHandler indeed handles these missing methods on top of InvocationHander (that we currently use).
But unfortunately, the equals() support in AbstractInvocationHandler is screwed up and doesnt fit our needs.
More to it the invoke() method in AbstractInvocationHandler is declared as final.

Hence have implemented a similar functionality on top of InvocationHandler.

In order to have a proper hashCode and equals for these Typed Interfaces, I had to add these methods to all the
Library schema unTyped classes such as Row, Column, BaseType, etc...

Also added IT to cover these methods.

Change-Id: Ia5c3081ae5ce20b9a8fd6ceaadbfd21145649078
Signed-off-by: Madhu Venugopal <mavenugo@gmail.com>
library/src/main/java/org/opendaylight/ovsdb/lib/notation/Column.java
library/src/main/java/org/opendaylight/ovsdb/lib/notation/Row.java
library/src/main/java/org/opendaylight/ovsdb/lib/schema/BaseType.java
library/src/main/java/org/opendaylight/ovsdb/lib/schema/ColumnSchema.java
library/src/main/java/org/opendaylight/ovsdb/lib/schema/ColumnType.java
library/src/main/java/org/opendaylight/ovsdb/lib/schema/typed/TyperUtils.java
schemas/openvswitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/OpenVswitchSchemaSuiteIT.java
schemas/openvswitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/TyperUtilsSpecialMethodsTestCases.java [new file with mode: 0644]