petroleum/src/main/java/pm/j4/petroleum/util/module/option/ConfigurationOption.java

60 lines
1.1 KiB
Java
Raw Normal View History

package pm.j4.petroleum.util.module.option;
import com.google.gson.JsonElement;
2020-12-20 04:25:27 +00:00
import pm.j4.petroleum.util.module.ModuleBase;
/**
* The type Configuration option.
*/
public abstract class ConfigurationOption {
2020-12-20 04:25:27 +00:00
/**
* The Description.
*/
private final String description;
2020-12-20 04:25:27 +00:00
private final String key;
private final ModuleBase parent;
2020-12-20 04:25:27 +00:00
/**
* Instantiates a new Configuration option.
*
* @param description the description
*/
public ConfigurationOption(String key, String description, ModuleBase parent) {
this.description = description;
2020-12-20 04:25:27 +00:00
this.key = key;
this.parent = parent;
}
2020-12-20 04:25:27 +00:00
/**
* Gets description.
*
* @return the description
*/
public final String getDescription() {
return this.description;
}
2020-12-20 04:25:27 +00:00
public final String getConfigKey() { return key; }
public final ModuleBase getParent() { return parent; }
2020-12-20 04:25:27 +00:00
/**
* Gets string value.
*
* @return the string value
*/
public abstract String getStringValue();
2020-12-20 04:25:27 +00:00
/**
* From json.
*
* @param e the e
*/
public abstract void fromJson(JsonElement e);
2020-12-20 04:25:27 +00:00
/**
* To json json element.
*
* @return the json element
*/
public abstract JsonElement toJson();
}