Generate toString method.