To create an immutable preferences object every time seems to be a waste of time and computer memory.
- Alter the existing object and return it (by a
with*-method, similar to a builder, but changing the object at hand).
- Create a new object every time a preferences object should be altered.
Chosen option: “Alter the exiting object”, because the preferences objects are just wrappers around the basic preferences framework of JDK. They should be mutable on-the-fly similar to objects with a Builder inside and to be stored immediately again in the preferences.