Not. But I do not find the following code too detailed
MyClass obj = new MyClass(); obj.number = 1; obj.text = "some text";
Or the good old constructor, causing too confusing
MyClass obj = new MyClass(1, "some text");
Some may suggest a chain of methods:
MyClass obj = new MyClass().number(1).text("some text"); class MyClass int number public MyClass number(int number){ this.number=number; return this; }
which requires an additional method for each field. This boiler plate code, IDE can help here.
Then there is a builder pattern that works even more for the author of the API.
irreputable
source share