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

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

What is the difference between data design and data model(ERD) -

ios - Can NSManagedObject conform to NSCoding -