From time to time, I'll have a class in Java that takes a multitude of parameters, however, sometimes when I am creating an object of this class, I don't need to use all the parameters. As of now, I usually set the parameters to null or 0 depending on the type. However, would it be easier if I just created chained methods to set certain fields in the class?
So, instead of:
MyClass someInstance = new MyClass(param0, null, null, 0, null, param5);
Have something like this:
MyClass someInstance = (new MyClass()).setParam0(param0).setParam5(param5);
Does this go against OOP or Java's usual paradigm?