Interface Memento


  • public interface Memento
    Serves as a storage abstraction to persist configuration information for model roots or other elements between sessions in a generic way. Mementos, in essence, resemble hierarchically organized hashmaps. The actual contents of the mementos and the shape of the hierarchy are a responsibility of the owning ModelRoot.
    • Method Detail

      • getType

        String getType()
        Returns the value of type for the memento. The value of null is returned if no type has been set.
      • put

        void put​(String key,
                 String value)
        Parameters:
        key - null doesn't make sense
        value - null value effectively removes the key
      • getKeys

        Iterable<String> getKeys()
        Retrieves a read-only collection of registered property keys. Since the collection is backed by the original collection, new properties must not be added while iterating.
      • setText

        void setText​(String text)
      • getChildren

        Iterable<Memento> getChildren​(String type)
        Retrieves a point-time read-only copy of all the children mementos of the specified type. Subsequent modifications to the original list of children of the current memento will not have any impact on the returned collection.
      • getChildren

        Iterable<Memento> getChildren()
        Retrieves a point-time read-only copy of all the children mementos. Subsequent modifications to the original list of children of the current memento will not have any impact on the returned collection.
      • createChild

        Memento createChild​(String type)
        Creates and registers a new child memento.
      • copy

        Memento copy()
        Returns a deep copy of the current memento and its children