I am trying to use Builder Pattern for my below class.. Initially I was using constructor of my class to set all the parameters but accidentally I came across Builder pattern an
public final class ModelInput {
...
public static class Builder {
private long userid;
...
public Builder setUserId(long userId) {
this.userId = userId;
}
...
public ModelInput build() {
return new ModelInput(userId,...
}
}
}