Package de.xima.fc.logic.data
Class DataStores
- java.lang.Object
-
- de.xima.fc.logic.data.DataStores
-
public final class DataStores extends Object
Factory fordata stores
.- Since:
- 8.2.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <K,V>
IDataStore<K,V>dataStoreForFacesContextAttributes(Object scope, Supplier<javax.faces.context.FacesContext> facesContextSupplier)
Creates a new data store that stores data in the attributes of a Faces context.static <K,V>
IDataStore<K,V>dataStoreNoOp()
Creates a no-op data store that does not store any data.
-
-
-
Method Detail
-
dataStoreForFacesContextAttributes
public static <K,V> IDataStore<K,V> dataStoreForFacesContextAttributes(Object scope, Supplier<javax.faces.context.FacesContext> facesContextSupplier)
Creates a new data store that stores data in the attributes of a Faces context.To prevent conflicts with other data stores, uses a custom scope. The scope is an arbitrary object that is used as a key in the attributes map of the faces context. It should be unique and not be used for other purposes.
- Type Parameters:
K
- The type of the keys.V
- The type of the values.- Parameters:
scope
- The scope object.facesContextSupplier
- A supplier that provides the Faces context to use.- Returns:
- A new data store.
-
dataStoreNoOp
public static <K,V> IDataStore<K,V> dataStoreNoOp()
Creates a no-op data store that does not store any data.- Type Parameters:
K
- The type of the keys.V
- The type of the values.- Returns:
- A no-op data store.
-
-