Java impose final programmatically -
what's proper way ensure value gets set once, although time set unknown (ie: not in constructor). null check or keep track of flag , throw exception - exception should throw? it's small, localized library , prefer not create own valuealreadyassigned exception such seemingly generic case.
the method throw illegalstateexception
, since it's javadocs say:
signals method has been invoked @ illegal inappropriate time.
Comments
Post a Comment