All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.alantea.storex.StorageList Maven / Gradle / Ivy

package net.alantea.storex;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * The Class StorageList.
 */
class StorageList implements Storable
{
   
   /** The content. */
   List content;

   /**
    * Instantiates a new storage list.
    *
    * @param content the content
    */
   public StorageList(List content)
   {
      this.content = content;
   }

   /**
    * Instantiates a new storage list.
    */
   public StorageList()
   {
      this.content = new ArrayList();
   }

   /* (non-Javadoc)
    * @see net.alantea.storex.Storable#getStorableAttributes()
    */
   @Override
   public Map getStorableAttributes()
   {
      return new HashMap();
   }

   /* (non-Javadoc)
    * @see net.alantea.storex.Storable#getStorableChildren()
    */
   @Override
   public List getStorableChildren()
   {
      return content;
   }

   /* (non-Javadoc)
    * @see net.alantea.storex.Storable#setStorableAttributes(java.util.Map)
    */
   @Override
   public void setStorableAttributes(Map attributes)
   {
      // Empty
   }

   /* (non-Javadoc)
    * @see net.alantea.storex.Storable#addStorableChild(java.lang.Object)
    */
   @Override
   public void addStorableChild(Object child)
   {
      content.add(child);
   }

}