Class GsonConfigurationLoader.Builder
- java.lang.Object
-
- org.spongepowered.configurate.loader.AbstractConfigurationLoader.Builder<GsonConfigurationLoader.Builder,GsonConfigurationLoader>
-
- org.spongepowered.configurate.gson.GsonConfigurationLoader.Builder
-
- Enclosing class:
- GsonConfigurationLoader
public static final class GsonConfigurationLoader.Builder extends AbstractConfigurationLoader.Builder<GsonConfigurationLoader.Builder,GsonConfigurationLoader>
Builds aGsonConfigurationLoader
.This builder supports the following options:
- <prefix>.gson.lenient
- Equivalent to
lenient(boolean)
- <prefix>.gson.indent
- Equivalent to
indent(int)
- Since:
- 4.0.0
-
-
Field Summary
-
Fields inherited from class org.spongepowered.configurate.loader.AbstractConfigurationLoader.Builder
DEFAULT_OPTIONS_SOURCE, defaultOptions, headerMode, sink, source
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull GsonConfigurationLoader
build()
int
indent()
Gets the level of indentation to be used by the resultant loader.@NonNull GsonConfigurationLoader.Builder
indent(int indent)
Sets the level of indentation the resultant loader should use.boolean
lenient()
Gets if the resultant loader should parse leniently.@NonNull GsonConfigurationLoader.Builder
lenient(boolean lenient)
Sets if the resultant loader should parse leniently.protected void
populate(LoaderOptionSource options)
-
Methods inherited from class org.spongepowered.configurate.loader.AbstractConfigurationLoader.Builder
buildAndLoadString, buildAndSaveString, defaultOptions, defaultOptions, defaultOptions, file, from, headerMode, headerMode, path, sink, sink, source, source, url
-
-
-
-
Method Detail
-
populate
protected void populate(LoaderOptionSource options)
- Overrides:
populate
in classAbstractConfigurationLoader.Builder<GsonConfigurationLoader.Builder,GsonConfigurationLoader>
-
indent
public @NonNull GsonConfigurationLoader.Builder indent(int indent)
Sets the level of indentation the resultant loader should use.- Parameters:
indent
- the indent level- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
-
indent
public int indent()
Gets the level of indentation to be used by the resultant loader.- Returns:
- the indent level
- Since:
- 4.0.0
-
lenient
public @NonNull GsonConfigurationLoader.Builder lenient(boolean lenient)
Sets if the resultant loader should parse leniently.- Parameters:
lenient
- whether the parser should parse leniently- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
- See Also:
JsonReader.setLenient(boolean)
-
lenient
public boolean lenient()
Gets if the resultant loader should parse leniently.- Returns:
- whether the parser should parse leniently
- Since:
- 4.0.0
-
build
public @NonNull GsonConfigurationLoader build()
- Specified by:
build
in classAbstractConfigurationLoader.Builder<GsonConfigurationLoader.Builder,GsonConfigurationLoader>
-
-