PropertiesConfig

class PropertiesConfig(val file: File)

Representation of a java.util.Properties based config file

Parameters

file

the file to load the config from (usually a file ending with .properties)

Constructors

Link copied to clipboard
constructor(file: File)

Properties

Link copied to clipboard
val file: File
Link copied to clipboard

Functions

Link copied to clipboard
fun add(key: String, value: String): PropertiesConfig

Adds the given key-value pair to the config and if the key already exists, it won't be overwritten

Link copied to clipboard

Destroys the config

Link copied to clipboard
fun get(key: String): String?

Gets the value of the given key

Link copied to clipboard
fun getOrDefault(key: String, default: String): String

Gets the value of the given key, or sets the given default value if the key doesn't exist

Link copied to clipboard
fun has(key: String): Boolean

Checks if the config contains the given key

Link copied to clipboard

Loads the config from the file

Link copied to clipboard

Removes the given key

Link copied to clipboard
fun save(vararg comments: String): PropertiesConfig

Saves the config to the file

Link copied to clipboard
fun set(key: String, value: String): PropertiesConfig

Sets the value of the given key