[MINOR] Type hint to setCustomMessages.

Just adding a type hint to setCustomMessages.