public final class FinalReference<T> extends Object implements Reference<T>, Serializable
Reference
. This class is used if you want to allow to set the
value of a Reference
only once. If you try to set the references
value twice an IllegalStateException
is thrown.Constructor and Description |
---|
FinalReference()
Create a new final reference.
|
FinalReference(T devault)
Create a new FinalReference with the given default value.
|
public FinalReference()
public FinalReference(T devault)
isFinal() == false
.devault
- the default value of the reference.public boolean isFinal()
Reference
can be set without throwing an
IllegalStateException
or not.true
if this Reference
can't be set again,
false otherwise.public void set(T value)
IllegalStateException
is thrown.set
in interface Reference<T>
IllegalStateException
- if you try to set the reference value twice.© 2007-2014 Franz Wilhelmstötter (2014-03-07 19:35)