Class JsonPathStorage<T>
java.lang.Object
com.github.startsmercury.simply.no.shading.util.storage.PathStorage<T>
com.github.startsmercury.simply.no.shading.util.storage.JsonPathStorage<T>
- Type Parameters:
T- the supported type for storing
- All Implemented Interfaces:
Storage<T>
Deprecated, for removal: This API element is subject to removal in a future version.
No replacement
A
JsonPathStorage is a concrete implementation of PathStorage
in that serialized state is stored in the JSON file format.- Since:
- 6.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionJsonPathStorage(Path path) Deprecated, for removal: This API element is subject to removal in a future version.Creates a newJsonPathStoragewith a set path, defaulted gson, and without runtime type-checking.JsonPathStorage(Path path, com.google.gson.Gson gson) Deprecated, for removal: This API element is subject to removal in a future version.Creates a newJsonPathStoragewith a set path, gson, and without runtime type-checking.JsonPathStorage(Path path, com.google.gson.Gson gson, Class<T> clazz) Deprecated, for removal: This API element is subject to removal in a future version.Creates a newJsonPathStoragewith a set path, gson, and class.JsonPathStorage(Path path, com.google.gson.Gson gson, Type type) Deprecated, for removal: This API element is subject to removal in a future version.Creates a newJsonPathStoragewith a set path, gson, and type.JsonPathStorage(Path path, Class<T> clazz) Deprecated, for removal: This API element is subject to removal in a future version.Creates a newJsonPathStoragewith a set path, defaulted gson, and class. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gson.GsongetGson()Deprecated, for removal: This API element is subject to removal in a future version.Returns the gson used for (de)serialization.protected final com.google.gson.GsonDeprecated, for removal: This API element is subject to removal in a future version.This is a utility method wraps aroundgetGson(), returning when not null; returns a fallback otherwise.getType()Deprecated, for removal: This API element is subject to removal in a future version.Returns the supported type for storing.load()Deprecated, for removal: This API element is subject to removal in a future version.Loads the stored state as a new object.voidDeprecated, for removal: This API element is subject to removal in a future version.Stores the state of a given object.Methods inherited from class com.github.startsmercury.simply.no.shading.util.storage.PathStorage
equals, getPath, hashCode, toString
-
Constructor Details
-
JsonPathStorage
Deprecated, for removal: This API element is subject to removal in a future version.Creates a newJsonPathStoragewith a set path, defaulted gson, and without runtime type-checking.- Parameters:
path- the path where object state is (de)serialized
-
JsonPathStorage
Deprecated, for removal: This API element is subject to removal in a future version.Creates a newJsonPathStoragewith a set path, defaulted gson, and class.- Parameters:
path- the path where object state is (de)serializedclazz- the supported type
-
JsonPathStorage
Deprecated, for removal: This API element is subject to removal in a future version.Creates a newJsonPathStoragewith a set path, gson, and without runtime type-checking.- Parameters:
path- the path where object state is (de)serializedgson- the gson used for (de)serialization
-
JsonPathStorage
Deprecated, for removal: This API element is subject to removal in a future version.Creates a newJsonPathStoragewith a set path, gson, and class.- Parameters:
path- the path where object state is (de)serializedgson- the gson used for (de)serializationclazz- the supported type
-
JsonPathStorage
Deprecated, for removal: This API element is subject to removal in a future version.Creates a newJsonPathStoragewith a set path, gson, and type.- Parameters:
path- the path where object state is (de)serializedgson- the gson used for (de)serializationtype- the supported type
-
-
Method Details
-
getGson
public com.google.gson.Gson getGson()Deprecated, for removal: This API element is subject to removal in a future version.Returns the gson used for (de)serialization.- Returns:
- the gson used for (de)serialization
-
getGsonElseFallback
protected final com.google.gson.Gson getGsonElseFallback()Deprecated, for removal: This API element is subject to removal in a future version.This is a utility method wraps aroundgetGson(), returning when not null; returns a fallback otherwise.- Returns:
- the gson used for (de)serialization
-
getType
Deprecated, for removal: This API element is subject to removal in a future version.Returns the supported type for storing.- Returns:
- the supported type for storing
-
load
Deprecated, for removal: This API element is subject to removal in a future version.Loads the stored state as a new object.- Returns:
- a new object loaded with the stored state
- Throws:
Exception- thrown when an implementation encountered a checked exception; the actual type may depend on the implementation
-
save
Deprecated, for removal: This API element is subject to removal in a future version.Stores the state of a given object.- Parameters:
obj- the object to store the state of- Throws:
Exception- thrown when an implementation encountered a checked exception; the actual type may depend on the implementation
-