2020-06-25 20:56:09 +00:00
|
|
|
package com.thebrokenrail.modupdater.api;
|
|
|
|
|
|
|
|
public interface ConfigObject {
|
|
|
|
String getString(String str) throws MissingValueException;
|
2020-06-28 17:43:17 +00:00
|
|
|
|
2020-06-25 20:56:09 +00:00
|
|
|
int getInt(String str) throws MissingValueException;
|
|
|
|
|
2020-07-25 18:10:06 +00:00
|
|
|
boolean getBoolean(String str) throws MissingValueException;
|
|
|
|
|
2020-06-25 20:56:09 +00:00
|
|
|
class MissingValueException extends Exception {
|
|
|
|
private static final String MISSING_MSG = "Missing Configuration Property: %s";
|
|
|
|
private static final String INVALID_MSG = "Invalid Configuration Property: %s";
|
|
|
|
|
|
|
|
public MissingValueException(boolean invalid, String property) {
|
|
|
|
super(String.format(invalid ? INVALID_MSG : MISSING_MSG, property));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|