java.lang.Object
com.aoapps.lang.attribute.Attribute.OldValue
- All Implemented Interfaces:
AutoCloseable
A backup value from before attribute initialization,
which must be
closed
to restore the old value.
This is best used in try-with-resources.-
Constructor Details
-
OldValue
-
-
Method Details
-
getOldValue
Gets the old value of the attribute, which will be restored onclose()
. This can be of any type, since this is used to backup arbitrary values before new scopes.- Returns:
- the old attribute value or
null
when none
-
close
public abstract void close()Restores the old value of the attribute.- Specified by:
close
in interfaceAutoCloseable
-