Class AbstractContainer<K>
java.lang.Object
com.marcusslover.plus.lib.container.AbstractContainer<K>
- Type Parameters:
K- Value type.
- Direct Known Subclasses:
MapContainer,SingleContainer
Abstract container that represents a parent of files, similar to a folder.
Default implementations are
MapContainer and SingleContainer.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @NotNull com.google.gson.GsongetGson()Gets the Gson instance.abstract voidAttempts to load all the data from the container.abstract voidPush the updated object to the cache and save it to the file.
-
Field Details
-
DEFAULT_GSON
protected static final com.google.gson.Gson DEFAULT_GSON -
parentFolder
-
-
Constructor Details
-
AbstractContainer
public AbstractContainer()
-
-
Method Details
-
getGson
@NotNull protected @NotNull com.google.gson.Gson getGson()Gets the Gson instance. By default, it isDEFAULT_GSON.- Returns:
- Gson instance.
-
update
Push the updated object to the cache and save it to the file.- Parameters:
key- Key of the object.
-
loadAllData
public abstract void loadAllData()Attempts to load all the data from the container. Look atInitialLoadingfor more information.
-