Class Attribute.OldValue

All Implemented Interfaces:
Enclosing class:

public abstract static class Attribute.OldValue extends Object implements 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

      protected OldValue(Object oldValue)
  • Method Details

    • getOldValue

      public Object getOldValue()
      Gets the old value of the attribute, which will be restored on close(). This can be of any type, since this is used to backup arbitrary values before new scopes.
      the old attribute value or null when none
    • close

      public abstract void close()
      Restores the old value of the attribute.
      Specified by:
      close in interface AutoCloseable