Package mcp.mobius.waila.api
Interface IJsonConfig<T>
- Type Parameters:
T
- the config class
An Interface for easy (de)serialization for config classes
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
static interface
static @interface
Adds comment for this value.static interface
A custom commenter. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
backup()
void
Backup and invalidate current value and force re-read file on nextget()
.get()
Get current valuegetPath()
void
Invalidate current value and force re-read file on nextget()
boolean
static <T> IJsonConfig.Builder0
<T> of
(com.google.gson.reflect.TypeToken<T> type) Creates a builder for generic config type.static <T> IJsonConfig.Builder0
<T> Creates a builder for concrete config type.void
save()
Save value to filevoid
Write value to file
-
Method Details
-
of
Creates a builder for concrete config type. -
of
Creates a builder for generic config type.Note: the object factory must be specified.
-
get
T get()Get current value -
save
void save()Save value to file -
write
Write value to file -
invalidate
void invalidate()Invalidate current value and force re-read file on nextget()
-
isFileExists
boolean isFileExists()- Returns:
- whether the config file exists.
-
getPath
Path getPath()- Returns:
- the path to the config file.
-
backup
Backup and invalidate current value and force re-read file on nextget()
. The backup will have a time suffix to it's file extension. -
backup
default void backup()- See Also:
-