siroky/Payola — comment on commit 6410ae0d2f5515b9b1309f292ead945ceeffd5b2
File: payola/common/src/main/scala/cz/payola/common/model/ParameterInstance.scala line 23
By charlieMonroe:

The setValue method is there in case we decide to use more complex values than bool/int/float/string... The value field from the constructor is indeed protected - see the model's ParameterInstance. In most cases, I keep the actual variable private/protected and add getter and setter (def value and def value_=) methods as well as a convenience method setValue which just calls the field setter. It might be redundant, but I personally like the setSomething methods and they are not that big of redundance.

See the package cz.payola.model.parameter - there already are all those classes that include all these methods. If a new subclass is created, these methods throw an exception by default. I just don't feel it can be a convenient feature, which if not used, doesn't block anything else.

toString is something that you should be able to use when debugging - i.e. it should show the class name, etc. (my opinion). Whereas stringValue clearly states it will give you *just* the value, nothing else. The toString method isn't something that is obvious for value conversion. (Example: the toString method should really return something like "BooleanParameter: value=true" so that in debug logging, you know it's not just Boolean - opposed to the suggested output "true")...