java.lang.Object
net.botwithus.rs3.script.config.ScriptConfig
- All Implemented Interfaces:
- ImmutableConfig,- MutableConfig
The ScriptConfiguration manages the persistence of configurations between the scripts.
 
Examples:
Examples:
 
  //Getting Properties
  ScriptConfiguration config = ...;
  String myValue = config.getProperty("my_property");
  System.out.println(myValue);
  //Adding Properties
  ScriptConfiguration config = ...;
  config.addProperty("my_property", "the_value");
  //Removing Properties
  ScriptConfiguration config = ...;
  config.removeProperty("my_property");
 
 - 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddProperty(String name, String value) Adds a key value pair of strings to the configurationbooleancontainsKey(String key) Checks if the properties map contains the specified key.getProperty(String name) Gets a value from the properties by a namevoidload()Loads the properties from the local configs folder.voidremoveProperty(String name) Removes a key from the configurationvoidsave()Saves the configuration to a file.
- 
Constructor Details- 
ScriptConfig
 
- 
- 
Method Details- 
containsKeyChecks if the properties map contains the specified key.- Specified by:
- containsKeyin interface- ImmutableConfig
- Parameters:
- key- The key to check for
- Returns:
- true if the key is present in the map, false otherwise
 
- 
getPropertyGets a value from the properties by a name- Specified by:
- getPropertyin interface- ImmutableConfig
- Parameters:
- name- The name of the property
 Example:- ScriptConfiguration config = ...; String myValue = config.getProperty("my_property"); System.out.println(myValue);
 
- 
addPropertyAdds a key value pair of strings to the configuration- Specified by:
- addPropertyin interface- MutableConfig
- Parameters:
- name- The name of the property
- value- The value of the property
 Example:- ScriptConfiguration config = ...; config.addProperty("my_property", "the_value");
 
- 
removePropertyRemoves a key from the configuration- Specified by:
- removePropertyin interface- MutableConfig
- Parameters:
- name- The name of the property
 Example:- ScriptConfiguration config = ...; config.removeProperty("my_property");
 
- 
saveSaves the configuration to a file.- Specified by:
- savein interface- ImmutableConfig
- Throws:
- IOException- if an I/O error occurs while saving the configuration
 
- 
loadpublic void load()Loads the properties from the local configs folder.- Specified by:
- loadin interface- MutableConfig
 
 
-