Module RandomTrainSimWorld2.main
Class Config
java.lang.Object
com.github.freddyyj.randomtrainsimworld.config.Config
public class Config extends Object
Default configuration class
Don't create this object directly. Use
Main
methods instead.- Author:
- FreddyYJ_
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Config()
Constructor -
Method Summary
-
Field Details
-
FILE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Config
Constructor- Throws:
FileNotFoundException
- Throws when config file(FILE_NAME
) missingIOException
- If I/O Exception occurred
-
-
Method Details
-
setConfig
Add or update value of key.- Parameters:
key
- target keyvalue
- target value
-
getConfig
Get value of key.If key doesn't exist, return null.
- Parameters:
key
- target key- Returns:
- value of key
-
save
Save changes.- Throws:
IOException
- If I/O exception occurred
-