- java.lang.Object
-
- com.github.alex1304.ultimategdbot.api.BotConfig
-
public final class BotConfig extends Object
Contains configuration resources for the bot. A resource is a set of properties that can be read via thePropertyReader
interface.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BotConfig
fromResourceMap(Map<String,PropertyReader> resources)
Creates a newBotConfig
initialized with resources defined in the given map.PropertyReader
resource(String name)
Gets a configuration resource by the given name.
-
-
-
Method Detail
-
fromResourceMap
public static BotConfig fromResourceMap(Map<String,PropertyReader> resources)
Creates a newBotConfig
initialized with resources defined in the given map.- Parameters:
resources
- the map containing the configuration resources. The key is the name of the resource, the value is the resource itself- Returns:
- a new
BotConfig
instance
-
resource
public PropertyReader resource(String name)
Gets a configuration resource by the given name.- Parameters:
name
- the name of the resource- Returns:
- the configuration resource associated with the name
- Throws:
IllegalArgumentException
- if the resource is not found
-
-