As par as I know concatinate String using + sign is not a good practice when you have large number of String. But when I check on eclipse generated toString() method (Write click on source file -> Source -> Generate toString() ) it has the same.
public class Temp
{
private String tempName;
private String tempValue;
// here getters and setters
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "Temp [tempName=" + tempName + ", tempValue=" + tempValue + "]";
}
}
Is there any place to configure like my expected toString() method like bellow in eclipse or Why the eclipse doesn't consider that.
public String expectedToString(){
StringBuffer sb = new StringBuffer();
sb.append("Temp [tempName=").append(tempName).append(",").append(" tempValue=").append(tempValue).append("]");
return sb.toString();
}
I'm going to use auto generated toString() method to log my object values.
Kindly advice me.