If you want to use same class for your key and value, Then you need to write only one custom class which implements WritableComparable Interface.
A class which implements WritableComparable interface can be used for Key and Value. That means your new custom class will be Writable and Comparable also.
The super interfaces of WritableComparable are Writable and Comparable.
Please verify this