upload
This commit is contained in:
34
README.md
34
README.md
@@ -27,17 +27,43 @@ Dependency
|
||||
File file = new File("config.yml");
|
||||
ConfigManager config = new ConfigManager(file);
|
||||
|
||||
// Load the data from the disk
|
||||
// 1. Load the data from the disk
|
||||
config.load();
|
||||
|
||||
// Read values easily
|
||||
// 2. Read values easily (supports dot-notation)
|
||||
String host = config.getString("mysql.host");
|
||||
int port = config.getInt("mysql.port");
|
||||
|
||||
// Update or Create new keys
|
||||
// 3. Working with Lists (e.g., worlds.fly)
|
||||
List<String> flyWorlds = config.getStringList("worlds.fly");
|
||||
if (!flyWorlds.contains("nether")) {
|
||||
flyWorlds.add("nether");
|
||||
}
|
||||
|
||||
// 4. Update or Create new keys
|
||||
config.set("mysql.port", 3307);
|
||||
config.set("commands.fly.enable", true);
|
||||
config.set("worlds.fly", flyWorlds); // Save the updated list
|
||||
|
||||
// Save the changes back to the file
|
||||
// 5. Save the changes back to the file
|
||||
config.save();
|
||||
```
|
||||
```yml
|
||||
mysql:
|
||||
host: localhost
|
||||
port: 3307
|
||||
database: database
|
||||
user: root
|
||||
password: "your-password"
|
||||
redis:
|
||||
host: localhost
|
||||
password: "your-password"
|
||||
commands:
|
||||
fly:
|
||||
enable: true
|
||||
worlds:
|
||||
fly:
|
||||
- world
|
||||
- end
|
||||
- nether
|
||||
```
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 18:59:07 UTC 2025 -->
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 19:08:13 UTC 2025 -->
|
||||
<title>All Classes and Interfaces (yml-manager 0.1 API)</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 18:59:07 UTC 2025 -->
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 19:08:13 UTC 2025 -->
|
||||
<title>All Packages (yml-manager 0.1 API)</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 18:59:07 UTC 2025 -->
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 19:08:13 UTC 2025 -->
|
||||
<title>API Help (yml-manager 0.1 API)</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 18:59:07 UTC 2025 -->
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 19:08:13 UTC 2025 -->
|
||||
<title>Index (yml-manager 0.1 API)</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 18:59:07 UTC 2025 -->
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 19:08:13 UTC 2025 -->
|
||||
<title>yml-manager 0.1 API</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 18:59:07 UTC 2025 -->
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 19:08:13 UTC 2025 -->
|
||||
<title>ConfigManager (yml-manager 0.1 API)</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 18:59:07 UTC 2025 -->
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 19:08:13 UTC 2025 -->
|
||||
<title>Uses of Class net.triler.ConfigManager (yml-manager 0.1 API)</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 18:59:07 UTC 2025 -->
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 19:08:13 UTC 2025 -->
|
||||
<title>net.triler (yml-manager 0.1 API)</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 18:59:07 UTC 2025 -->
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 19:08:13 UTC 2025 -->
|
||||
<title>net.triler Class Hierarchy (yml-manager 0.1 API)</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 18:59:07 UTC 2025 -->
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 19:08:13 UTC 2025 -->
|
||||
<title>Uses of Package net.triler (yml-manager 0.1 API)</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 18:59:07 UTC 2025 -->
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 19:08:13 UTC 2025 -->
|
||||
<title>Class Hierarchy (yml-manager 0.1 API)</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 18:59:07 UTC 2025 -->
|
||||
<!-- Generated by javadoc (21) on Wed Dec 17 19:08:13 UTC 2025 -->
|
||||
<title>Search (yml-manager 0.1 API)</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
@@ -28,22 +28,22 @@ net.triler
|
||||
/config/.m2/repository/org/yaml/snakeyaml/2.3/snakeyaml-2.3.jar = 1725124922000
|
||||
/config/workspace/yml-manager/src/main/java = 1765997171089
|
||||
/config/workspace/yml-manager/target/generated-sources/annotations = 1765997340661
|
||||
/config/workspace/yml-manager/target/apidocs/copy.svg = 1765997947919
|
||||
/config/workspace/yml-manager/target/apidocs/help-doc.html = 1765997947915
|
||||
/config/workspace/yml-manager/target/apidocs/link.svg = 1765997947920
|
||||
/config/workspace/yml-manager/target/apidocs/allclasses-index.html = 1765997947890
|
||||
/config/workspace/yml-manager/target/apidocs/overview-tree.html = 1765997947877
|
||||
/config/workspace/yml-manager/target/apidocs/search.js = 1765997947922
|
||||
/config/workspace/yml-manager/target/apidocs/tag-search-index.js = 1765997947895
|
||||
/config/workspace/yml-manager/target/apidocs/index-all.html = 1765997947904
|
||||
/config/workspace/yml-manager/target/apidocs/type-search-index.js = 1765997947894
|
||||
/config/workspace/yml-manager/target/apidocs/member-search-index.js = 1765997947895
|
||||
/config/workspace/yml-manager/target/apidocs/search.html = 1765997947907
|
||||
/config/workspace/yml-manager/target/apidocs/index.html = 1765997947909
|
||||
/config/workspace/yml-manager/target/apidocs/allpackages-index.html = 1765997947892
|
||||
/config/workspace/yml-manager/target/apidocs/stylesheet.css = 1765997947918
|
||||
/config/workspace/yml-manager/target/apidocs/search-page.js = 1765997947923
|
||||
/config/workspace/yml-manager/target/apidocs/script.js = 1765997947919
|
||||
/config/workspace/yml-manager/target/apidocs/module-search-index.js = 1765997947893
|
||||
/config/workspace/yml-manager/target/apidocs/package-search-index.js = 1765997947894
|
||||
/config/workspace/yml-manager/target/apidocs/element-list = 1765997947851
|
||||
/config/workspace/yml-manager/target/apidocs/copy.svg = 1765998493924
|
||||
/config/workspace/yml-manager/target/apidocs/help-doc.html = 1765998493919
|
||||
/config/workspace/yml-manager/target/apidocs/link.svg = 1765998493925
|
||||
/config/workspace/yml-manager/target/apidocs/allclasses-index.html = 1765998493881
|
||||
/config/workspace/yml-manager/target/apidocs/overview-tree.html = 1765998493865
|
||||
/config/workspace/yml-manager/target/apidocs/search.js = 1765998493926
|
||||
/config/workspace/yml-manager/target/apidocs/tag-search-index.js = 1765998493888
|
||||
/config/workspace/yml-manager/target/apidocs/index-all.html = 1765998493901
|
||||
/config/workspace/yml-manager/target/apidocs/type-search-index.js = 1765998493887
|
||||
/config/workspace/yml-manager/target/apidocs/member-search-index.js = 1765998493888
|
||||
/config/workspace/yml-manager/target/apidocs/search.html = 1765998493904
|
||||
/config/workspace/yml-manager/target/apidocs/index.html = 1765998493906
|
||||
/config/workspace/yml-manager/target/apidocs/allpackages-index.html = 1765998493884
|
||||
/config/workspace/yml-manager/target/apidocs/stylesheet.css = 1765998493922
|
||||
/config/workspace/yml-manager/target/apidocs/search-page.js = 1765998493927
|
||||
/config/workspace/yml-manager/target/apidocs/script.js = 1765998493923
|
||||
/config/workspace/yml-manager/target/apidocs/module-search-index.js = 1765998493885
|
||||
/config/workspace/yml-manager/target/apidocs/package-search-index.js = 1765998493887
|
||||
/config/workspace/yml-manager/target/apidocs/element-list = 1765998493833
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user