V
visionset
I'm using the Preferences class and have some objects to represent with
Strings for storage.
I have for example a rectangle class that may have a string representation
"0,0,50,100".
Now saving a property is not a problem I just have a CustomProperty
interface and call toPropertyString().
But loading a property is a case of documenting that CustomProperty classes
must provide a no arg public contstructor, and then I can call
CustomProperty.fromPropertyString(myPropStr) to populate the object.
Now I'd really like to have immutable properties, and I realise I can have a
toImmutableInstance() method but are there any better solutions to my mai
goal?
Strings for storage.
I have for example a rectangle class that may have a string representation
"0,0,50,100".
Now saving a property is not a problem I just have a CustomProperty
interface and call toPropertyString().
But loading a property is a case of documenting that CustomProperty classes
must provide a no arg public contstructor, and then I can call
CustomProperty.fromPropertyString(myPropStr) to populate the object.
Now I'd really like to have immutable properties, and I realise I can have a
toImmutableInstance() method but are there any better solutions to my mai
goal?