Class MementoImpl

  • All Implemented Interfaces:
    Memento

    public class MementoImpl
    extends Object
    implements Memento
    evgeny, 11/16/12
    • Constructor Detail

      • MementoImpl

        public MementoImpl()
    • Method Detail

      • getType

        public String getType()
        Description copied from interface: Memento
        Returns the value of type for the memento. The value of null is returned if no type has been set.
        Specified by:
        getType in interface Memento
      • put

        public void put​(String key,
                        String value)
        Specified by:
        put in interface Memento
        Parameters:
        key - null doesn't make sense
        value - null value effectively removes the key
      • getKeys

        public Iterable<String> getKeys()
        Description copied from interface: Memento
        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.
        Specified by:
        getKeys in interface Memento
      • getChildren

        public Iterable<Memento> getChildren​(String type)
        Description copied from interface: Memento
        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.
        Specified by:
        getChildren in interface Memento
      • getChildren

        public Iterable<Memento> getChildren()
        Description copied from interface: Memento
        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.
        Specified by:
        getChildren in interface Memento
      • createChild

        public Memento createChild​(String type)
        Description copied from interface: Memento
        Creates and registers a new child memento.
        Specified by:
        createChild in interface Memento
      • copy

        public Memento copy()
        Description copied from interface: Memento
        Returns a deep copy of the current memento and its children
        Specified by:
        copy in interface Memento
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object