Package com.oopsclick.silk.storage
Class ObjectStorage
- java.lang.Object
-
- com.oopsclick.silk.storage.ObjectStorage
-
public class ObjectStorage extends java.lang.Object
The Class ObjectStorage stores ObjectStructure objects. This class is used to create a Spring Bean which will store the ObjectStructure objects in a common repository. The objects are identified by their path which is provided during creation. The objects returned are new object result of a cloning process. This is done so any post change to the object will not affect the stored object.- Author:
- Italo Osorio
-
-
Constructor Summary
Constructors Constructor Description ObjectStorage()
Instantiates a new object storage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanStorage()
Cleans the storage objects.java.lang.Boolean
exist(java.lang.String path)
Returns if the object exist in the storage.ObjectStructure
get(java.lang.String path)
Gets an objectStructure from the storagevoid
put(java.lang.String path, ObjectStructure objectStructure)
Adds an objectStructure to the storage.java.lang.String
toString()
Return the list of Object stored.java.lang.String
toString(java.lang.String path)
-
-
-
Method Detail
-
put
public void put(java.lang.String path, ObjectStructure objectStructure)
Adds an objectStructure to the storage. If the object path already exist the object is replaced.- Parameters:
path
- The object path is used as the object identifier.objectStructure
- The object structure to store.
-
get
public ObjectStructure get(java.lang.String path)
Gets an objectStructure from the storage- Parameters:
path
- the path- Returns:
- the object structure
-
exist
public java.lang.Boolean exist(java.lang.String path)
Returns if the object exist in the storage.- Parameters:
path
- the path- Returns:
- the boolean
-
cleanStorage
public void cleanStorage()
Cleans the storage objects.
-
toString
public java.lang.String toString()
Return the list of Object stored.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the string
-
toString
public java.lang.String toString(java.lang.String path)
-
-