Found out that WikiBasePageObject has a method getNameForArticle() that does exactly what I need to accomplish here.