Deprecated and added a few java api methods for corresponding scala api.