Respecting some design principles can avoid you to waist a lot of time. Several problems are recurrent in the OOP world. That's why some solutions have pointed out along the time, the design patterns concept allow us to use these solutions in our program. What is important to notice is that design patterns usually help to solve complex problem if you are sure that the chosen pattern can apply, otherwise it can make your code more complex and less understandable, even by you
The factory pattern is designed to favor the separation between the object creation and the business logic. What is very costly in general, is to modify the business logic in order to adapt this logic to match new inputs for manipulated objects.
In the factory pattern, what is important, is to identify the kind of object a factory can generate. A factory is forced to output the same kind of object, meaning that it cannot produce 2 objects which do not share the same behaviour. As an example for this pre-requisite: in the real life, a factory cannot produce a car and a boat at the same time. So in the Java World you should avoid (even if possible) to make a too generic factory.