You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mr Zombii edited this page Mar 26, 2024
·
4 revisions
Building Your Config
BasicConfig.BuilderconfigBuilderBasicConfig.makeIfNotExists("anyConfigName");
configBuilder.addOption("testOption1", "Hello I'm A Config Value :)");
BasicConfigcfg = configBuilder.build();
cfg.getValue("testOption1", "Default Config Value :)");
To create a config you would call the BasicConfig.makeifNotExists method and supply it with the name of choice for your config.
To add options to the config file you do .addOption to your config builder to add a key and a value that can be any Number Type, String, Or Boolean.
To build your config and use it you can now call .build() and .getValue can be used to get your option you set in the config. With .getValue you need to pass the key for the option and the default value if getting the key fails.
Getting an Existing Config
BasicConfigcfg = BasicConfig.find("anyConfigName");
cfg.getValue("testOption1", "Default Config Value :)");
To get your existing config you can call BasicConfig.find and you can pass the name of your config like "TestConfig".