Package dev.oumaimaa.kawaiiapi.config
Annotation Interface Config
Annotation to mark a class as a configuration file.
Must be placed on classes that will be used with ConfigManager.
Example usage:
@Config(fileName = "config", fileType = ConfigManager.FileType.YAML)
public class MyConfig {
public String serverName = "My Server";
public int maxPlayers = 100;
public List<String> enabledWorlds = List.of("world", "world_nether");
// No-args constructor required
public MyConfig() {}
}
- Version:
- 1.0
- Author:
- KawaiiDevelopment
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionThe base name of the configuration file (without extension).The format/type of the configuration file. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether to create backups when saving the configuration.
-
Element Details
-
fileName
String fileNameThe base name of the configuration file (without extension). The appropriate extension (.json or .yml) will be added automatically.- Returns:
- The file name
-
fileType
ConfigManager.FileType fileTypeThe format/type of the configuration file.- Returns:
- The file type (JSON or YAML)
-
createBackup
boolean createBackupWhether to create backups when saving the configuration. Backups are timestamped and stored in the backups/ folder.- Returns:
- true to create backups, false otherwise
- Default:
false
-