Package com.iizix.api
Interface IPrivateStorage
- All Known Subinterfaces:
- IAppSessionGyro,- IClientSessionGyro
 - All Known Implementing Classes:
- AppSessionGyro,- ClientSessionGyro,- EditorVirtualSpace,- SessionInfo,- VirtualSpace
 - public interface IPrivateStorageThe private storage interface is used in components in order to provide a programmatic storage that lives with the component it is attached to. An example would be the- VirtualSpace- Author:
- Christopher Mindus
 
- Method Summary- All Methods Instance Methods Abstract Methods Default Methods - Modifier and Type - Method - Description - default java.lang.Object- getPrivateData(java.lang.String key)Gets an Object in the private storage map.- default <T> T- getPrivateData(java.lang.String key, java.lang.Class<T> clazz)Gets an Object in the private storage map of a specified class.- java.util.Map<java.lang.String,java.lang.Object>- getPrivateStorageMap()Gets the concurrent hash map used to store the private data.- default java.lang.Object- setPrivateData(java.lang.String key, java.lang.Object data)Adds a new Object to the private storage map, overwriting existing objects.
 
- Method Detail- getPrivateStorageMap- java.util.Map<java.lang.String,java.lang.Object> getPrivateStorageMap() Gets the concurrent hash map used to store the private data.- Returns:
- The private storage map.
 
 - setPrivateData- default java.lang.Object setPrivateData(java.lang.String key, java.lang.Object data)Adds a new Object to the private storage map, overwriting existing objects.- Parameters:
- key- The key for the data, not null.
- data- The data Object,- nullto remove the key.
- Returns:
- A previously overwritten or removed object, or nullif none were present.
- Throws:
- java.lang.NullPointerException- If the- keyis null.
 
 - getPrivateData- default java.lang.Object getPrivateData(java.lang.String key) Gets an Object in the private storage map.- Parameters:
- key- The key for the data, not null.
- Returns:
- The object for the key, nullif none is present.
- Throws:
- java.lang.NullPointerException- If the- keyis null.
 
 - getPrivateData- default <T> T getPrivateData(java.lang.String key, java.lang.Class<T> clazz)Gets an Object in the private storage map of a specified class.- If the object exists but is of wrong class, an error is logged. - A warning is logged in the server if the key was present but did not contain the expected class of the object in question. The warning will also include a stack trace for debugging purposes. - Type Parameters:
- T- The object class requested.
- Parameters:
- key- The key for the data, not null.
- clazz- The class of the object.
- Returns:
- The Object for the specified key, null for none (or not of the correct class).