Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
2.2.0, 2.3.0
-
None
Description
GenericMailet is made to be a convenient basic Mailet implementation, so it may be useful for it to provide this standard form of convenience method:
String getInitParameter(String name, String default) {
String param = getInitParameter(name);
return param != null ? param : default;
}
Another similar convenience method might verify that a given parameter exists and throw an appropriate standard exception if it does not.
Same goes for a parameter accessor that parses and returns integers(or throws standard exception if invalid formatted number).
Currently, handling init params requires doing these anyway, so it ay as well be in the generic implementation...