Add comparison implementation to object.