adam bien's blog

NetBeans Got An Excellent toString Generator 📎

NetBeans 6.8 doesn't come with a toString generator out of the box. The toString generator solved the problem very well. The generator is available from the alt+insert (ctrl+i) pop-up - and so very convenient to use. You can choose between String and StringBuilder based generation. It works as expected: 

public class ToStringTest {

    private String name;
    private int age;
    private Boolean flag;
    private String descripton;

   //was generated
    @Override
    public String toString() {
        return "ToStringTest [" + "age " + age + " " + "descripton " + descripton + " " + "flag " + flag + " " + "name " + name + "]";
    }
}

 

One problem - I didn't found any reference to a NBM file and had to build it manually. It is very easy, but it takes few minutes and is inconvenient. I'm sure, that Simon is already working on a CI solution :-).