Package com.iizix.api
Interface IPrivateStorage
- All Known Subinterfaces:
- IAppSessionGyro,- IClientSessionGyro
- All Known Implementing Classes:
- AppSessionGyro,- ClientSessionGyro,- EditorVirtualSpace,- SessionInfo,- VirtualSpace
public interface IPrivateStorage
The 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 SummaryModifier and TypeMethodDescription- default Object- getPrivateData- (String key) Gets an Object in the private storage map.- default <T> T- getPrivateData- (String key, Class<T> clazz) Gets an Object in the private storage map of a specified class.Gets the concurrent hash map used to store the private data.- default Object- setPrivateData- (String key, Object data) Adds a new Object to the private storage map, overwriting existing objects.
- Method Details- getPrivateStorageMapGets the concurrent hash map used to store the private data.- Returns:
- The private storage map.
 
- setPrivateDataAdds 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:
- NullPointerException- If the- keyis null.
 
- getPrivateDataGets 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:
- NullPointerException- If the- keyis null.
 
- getPrivateDataGets 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, nullfor none (or not of the correct class).