Class KarmaYamlManager
java.lang.Object
ml.karmaconfigs.api.common.karmafile.karmayaml.KarmaYamlManager
Karma yaml manager
-
Constructor Summary
ConstructorsConstructorDescriptionKarmaYamlManager(@NotNull KarmaYamlManager defaults, File configuration)Initialize the karma yaml managerKarmaYamlManager(@NotNull KarmaYamlManager defaults, InputStream configuration)Initialize the karma yaml managerKarmaYamlManager(@NotNull KarmaYamlManager defaults, Reader configuration)Initialize the karma yaml managerKarmaYamlManager(@NotNull KarmaYamlManager defaults, String configuration, boolean isPath)Initialize the karma yaml managerKarmaYamlManager(@NotNull KarmaYamlManager defaults, Path configuration)Initialize the karma yaml managerKarmaYamlManager(@NotNull KarmaYamlManager defaults, Map<?,?> values)Initialize the karma yaml managerKarmaYamlManager(@NotNull KarmaYamlManager defaults, KarmaSource source, String name, String... sub)Initialize the karma yaml managerKarmaYamlManager(File configuration)Initialize the karma yaml managerKarmaYamlManager(InputStream configuration)Initialize the karma yaml managerKarmaYamlManager(Reader configuration)Initialize the karma yaml managerKarmaYamlManager(String configuration, boolean isPath)Initialize the karma yaml managerKarmaYamlManager(Path configuration)Initialize the karma yaml managerKarmaYamlManager(Map<?,?> values)Initialize the karma yaml managerKarmaYamlManager(KarmaSource source, String name, String... sub)Initialize the karma yaml manager -
Method Summary
Modifier and TypeMethodDescription@Nullable ObjectGet a valueGet a valuebooleangetBoolean(String path)Get a valuebooleangetBoolean(String path, boolean def)Get a value@NotNull KarmaYamlManager[]Get the yaml childrendoubleGet a valuedoubleGet a value<T> TgetInstance(String path)Get an object instanceintGet a valueintGet a valueGet the yaml keysGet a valueGet a valuelongGet a valuelongGet a value@Nullable KarmaYamlManagerGet the yaml parent@NotNull KarmaYamlManager[]Get the yaml parents@Nullable YamlReloaderGet the yaml reloader@NotNull StringgetRoot()Get the yaml root key@NotNull KarmaYamlManagergetSection(String path)Get a section of the yaml@NotNull KarmaYamlManagergetSection(String path, KarmaYamlManager defaults)Get a section of the yaml@NotNull KYMSourceGet the yaml source root@NotNull StringGet a valueGet a valuegetStringList(String path)Get a valuegetStringList(String path, String... defaults)Get a value@NotNull KarmaYamlManagerGet the master tree of the yaml parentbooleanGet if the specified key is a sectionbooleanGet if the specified key is set in the yaml filebooleanmatchesWith(String path, Class<?> expected)Get if the specified value matches with the expected value@NotNull KarmaYamlManagerSave the current yaml@NotNull KarmaYamlManagersave(File target, KarmaSource source, String resource)Save the current yaml@NotNull KarmaYamlManagerSet the yaml valuespacer(char spacerChar)Set the manager spacer<T> @NotNull KarmaYamlManagerStore an object instance@NotNull StringtoString()Yaml to stringvoidupdate(KarmaYamlManager configuration, boolean addNew, String... ignore)Update the current manager
-
Constructor Details
-
KarmaYamlManager
Initialize the karma yaml manager- Parameters:
source- the yaml sourcename- the yaml file namesub- the yaml file folder
-
KarmaYamlManager
Initialize the karma yaml manager- Parameters:
configuration- the yaml
-
KarmaYamlManager
Initialize the karma yaml manager- Parameters:
configuration- the yaml
-
KarmaYamlManager
Initialize the karma yaml manager- Parameters:
configuration- the yaml configuration/pathisPath- if the yaml configuration string is a path
-
KarmaYamlManager
Initialize the karma yaml manager- Parameters:
configuration- the yaml
-
KarmaYamlManager
Initialize the karma yaml manager- Parameters:
configuration- the yaml
-
KarmaYamlManager
Initialize the karma yaml manager- Parameters:
values- the yaml key/value
-
KarmaYamlManager
public KarmaYamlManager(@NotNull @NotNull KarmaYamlManager defaults, KarmaSource source, String name, String... sub)Initialize the karma yaml manager- Parameters:
defaults- the yaml defaultssource- the yaml sourcename- the yaml file namesub- the yaml file folder
-
KarmaYamlManager
Initialize the karma yaml manager- Parameters:
defaults- the yaml defaultsconfiguration- the yaml
-
KarmaYamlManager
Initialize the karma yaml manager- Parameters:
defaults- the yaml defaultsconfiguration- the yaml
-
KarmaYamlManager
public KarmaYamlManager(@NotNull @NotNull KarmaYamlManager defaults, String configuration, boolean isPath)Initialize the karma yaml manager- Parameters:
defaults- the yaml defaultsconfiguration- the yaml configuration/pathisPath- if the yaml configuration string is a path
-
KarmaYamlManager
Initialize the karma yaml manager- Parameters:
defaults- the yaml defaultsconfiguration- the yaml
-
KarmaYamlManager
Initialize the karma yaml manager- Parameters:
defaults- the yaml defaultsconfiguration- the yaml
-
KarmaYamlManager
Initialize the karma yaml manager- Parameters:
defaults- the yaml defaultsvalues- the yaml key/value
-
-
Method Details
-
spacer
Set the manager spacer- Parameters:
spacerChar- the manager spacer- Returns:
- this instance
-
update
Update the current manager- Parameters:
configuration- the configuration to update fromaddNew- add non-existent keysignore- ignored keys
-
set
Set the yaml value- Parameters:
path- the key pathvalue- the key value- Returns:
- this instance
-
store
Store an object instance- Type Parameters:
T- the type to store- Parameters:
path- the instance object pathobject- the object to store- Returns:
- this instance
-
getSourceRoot
Get the yaml source root- Returns:
- the yaml source root
-
getReloader
Get the yaml reloader- Returns:
- the yaml reloader ( only valid for file/path/configuration path yaml generated sources )
-
getRoot
Get the yaml root key- Returns:
- the yaml root key
-
getParent
Get the yaml parent- Returns:
- the yaml parent
-
getParents
Get the yaml parents- Returns:
- all the yaml parents
-
getChildren
Get the yaml children- Returns:
- all the yaml children
-
getTreeMaster
Get the master tree of the yaml parent- Returns:
- the master tree of the yaml parent
-
save
Save the current yaml- Parameters:
target- the file to save in- Returns:
- this instance
-
save
Save the current yaml- Parameters:
target- the file to save insource- the source to read defaults fromresource- the internal resource to read defaults from- Returns:
- this instance
-
getKeySet
Get the yaml keys- Returns:
- the yaml key set
-
get
Get a value- Parameters:
path- the key pathdef- the key default value- Returns:
- the yaml value
-
get
Get a value- Parameters:
path- the key path- Returns:
- the yaml value
-
getList
Get a value- Parameters:
path- the key path- Returns:
- the yaml value
-
getList
Get a value- Parameters:
path- the key pathdefaults- the key default values- Returns:
- the yaml value
-
getString
Get a value- Parameters:
path- the key path- Returns:
- the yaml value
-
getString
Get a value- Parameters:
path- the key pathdef- the key default value- Returns:
- the yaml value
-
getInt
Get a value- Parameters:
path- the key path- Returns:
- the yaml value
-
getInt
Get a value- Parameters:
path- the key pathdef- the key default value- Returns:
- the yaml value
-
getDouble
Get a value- Parameters:
path- the key path- Returns:
- the yaml value
-
getDouble
Get a value- Parameters:
path- the key pathdef- the key default value- Returns:
- the yaml value
-
getLong
Get a value- Parameters:
path- the key path- Returns:
- the yaml value
-
getLong
Get a value- Parameters:
path- the key pathdef- the key default value- Returns:
- the yaml value
-
getBoolean
Get a value- Parameters:
path- the key path- Returns:
- the yaml value
-
getBoolean
Get a value- Parameters:
path- the key pathdef- the key default value- Returns:
- the yaml value
-
getStringList
Get a value- Parameters:
path- the key path- Returns:
- the yaml value
-
getStringList
Get a value- Parameters:
path- the key pathdefaults- the key default values- Returns:
- the yaml value
-
getInstance
Get an object instance- Type Parameters:
T- the instance type- Parameters:
path- the instance string key- Returns:
- the instance object
-
getSection
Get a section of the yaml- Parameters:
path- the section path- Returns:
- the section
-
getSection
Get a section of the yaml- Parameters:
path- the section pathdefaults- the section defaults- Returns:
- the section
-
isSection
Get if the specified key is a section- Parameters:
path- the key- Returns:
- if the path is a section
-
isSet
Get if the specified key is set in the yaml file- Parameters:
path- the key- Returns:
- if the path is set
-
matchesWith
Get if the specified value matches with the expected value- Parameters:
path- the keyexpected- the expected value type- Returns:
- if the value matches with the expected value type
-
toString
Yaml to string
-