Interface ConfigResolver
- All Known Implementing Classes:
ConfigResolverImpl
Should be used for implementing new configuration types
- Since:
- 2.0.0
- Author:
- MrIvanPlays
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
default void
dump
(Object annotatedConfig, OutputStream os) void
void
Loads the specifiedannotatedConfig
from the specifiedFile
file
using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
.void
load
(Object annotatedConfig, File file, LoadSettings loadSettings) Loads the specifiedannotatedConfig
from the specifiedFile
file
using theLoadSettings
loadSettings
specified.default void
load
(Object annotatedConfig, InputStream in) Loads the specifiedannotatedConfig
from the specifiedInputStream
in
using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
.default void
load
(Object annotatedConfig, InputStream in, LoadSettings loadSettings) Loads the specifiedannotatedConfig
from the specifiedInputStream
in
using theLoadSettings
loadSettings
specified.void
Loads the specifiedannotatedConfig
from the specifiedReader
reader
using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
.void
load
(Object annotatedConfig, Reader reader, LoadSettings loadSettings) Loads the specifiedannotatedConfig
from the specifiedReader
reader
using theLoadSettings
loadSettings
specified.void
loadOrDump
(Object annotatedConfig, File file) Loads the specifiedannotatedConfig
from the specifiedFile
file
, if it exists, if not, dumps the specifiedannotatedConfig
to the specified file, using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
.void
loadOrDump
(Object annotatedConfig, File file, LoadSettings loadSettings) Loads the specifiedannotatedConfig
from the specifiedFile
file
, if it exists, if not, dumps the specifiedannotatedConfig
to the specified file, using theLoadSettings
loadSettings
specified.static ConfigResolver.Builder
Creates a newConfigResolver.Builder
options()
Returns theCustomOptions
instance.
-
Method Details
-
newBuilder
Creates a newConfigResolver.Builder
- Returns:
- new builder
-
options
Returns theCustomOptions
instance.- Returns:
- options
- See Also:
-
dump
Dumps the specifiedannotatedConfig
to the specifiedFile
file
. If, at the time of calling this method, the file exists, it will get deleted ( default implementation ).If you are going to call
load(Object, File, LoadSettings)
after calling this method, consider usingloadOrDump(Object, File, LoadSettings)
rather than calling dump and load one after each other. This way you save CPU time by not making the library find annotations twice.- Parameters:
annotatedConfig
- the annotated config you want to dumpfile
- the file you want to dump the annotated config to
-
dump
- Parameters:
annotatedConfig
- the annotated config you want to dumpos
- the output stream to dump the annotated config to
-
dump
- Parameters:
annotatedConfig
- the annotated config you want to dumpwriter
- the writer to dump the annotated config to
-
load
Loads the specifiedannotatedConfig
from the specifiedFile
file
using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
.If you have called
dump(Object, File)
before calling this method, consider usingloadOrDump(Object, File)
rather than calling dump and load one after each other. This way you save CPU time by not making the library find annotations twice.- Parameters:
annotatedConfig
- the annotated config you want to load tofile
- the file you want to load
-
load
Loads the specifiedannotatedConfig
from the specifiedFile
file
using theLoadSettings
loadSettings
specified.If you have called
dump(Object, File)
before calling this method, consider usingloadOrDump(Object, File, LoadSettings)
rather than calling dump and load one after each other. This way you save CPU time by not making the library find annotations twice.- Parameters:
annotatedConfig
- the annotated config you want to load tofile
- the file you want to loadloadSettings
- the load settings
-
load
Loads the specifiedannotatedConfig
from the specifiedInputStream
in
using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
.If you have a
File
instance before calling that, consider usingload(Object, File)
. This way you allow AnnotatedConfig to generate missing options if the load settings allow it.- Parameters:
annotatedConfig
- the annotated config you want to load toin
- the input stream you want to load
-
load
Loads the specifiedannotatedConfig
from the specifiedInputStream
in
using theLoadSettings
loadSettings
specified.If you have a
File
instance before calling that, consider usingload(Object, File, LoadSettings)
. This way you allow AnnotatedConfig to generate missing options if the load settings allow it.- Parameters:
annotatedConfig
- the annotated config you want to load toin
- the input stream you want to loadloadSettings
- the load settings
-
load
Loads the specifiedannotatedConfig
from the specifiedReader
reader
using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
.If you have a
File
instance before calling that, consider usingload(Object, File)
. This way you allow AnnotatedConfig to generate missing options if the load settings allow it.- Parameters:
annotatedConfig
- the annotated config you want to load toreader
- the reader you want to load
-
load
Loads the specifiedannotatedConfig
from the specifiedReader
reader
using theLoadSettings
loadSettings
specified.If you have a
File
instance before calling that, consider usingload(Object, File, LoadSettings)
. This way you allow AnnotatedConfig to generate missing options if the load settings allow it.- Parameters:
annotatedConfig
- the annotated config you want to load toreader
- the reader you want to loadloadSettings
- the load settings
-
loadOrDump
Loads the specifiedannotatedConfig
from the specifiedFile
file
, if it exists, if not, dumps the specifiedannotatedConfig
to the specified file, using the defaultLoadSettings
from the builder of this config resolver, orLoadSettings.getDefault()
.- Parameters:
annotatedConfig
- the annotated config you want to load/dumpfile
- the file you want to load/dump to
-
loadOrDump
Loads the specifiedannotatedConfig
from the specifiedFile
file
, if it exists, if not, dumps the specifiedannotatedConfig
to the specified file, using theLoadSettings
loadSettings
specified.- Parameters:
annotatedConfig
- the annotated config you want to load/dumpfile
- the file you want to load/dump toloadSettings
- the load settings
-