petroleum/src/main/java/pm/j4/petroleum/modules/base/ConfigurationOption.java

69 lines
1.0 KiB
Java

package pm.j4.petroleum.modules.base;
/**
* The type Configuration option.
*
* @param <T> the type parameter
*/
public class ConfigurationOption<T extends StringWritable> {
/**
* The Value.
*/
private T value;
/**
* Instantiates a new Configuration option.
*
* @param initialValue the initial value
*/
public ConfigurationOption(T initialValue) {
this.value = initialValue;
}
/**
* Sets value.
*
* @param value the value
*/
public void setValue(T value) {
this.value = value;
}
/**
* Gets value.
*
* @return the value
*/
public T getValue() {
return this.value;
}
/**
* To string value string.
*
* @return the string
*/
public String toStringValue() {
return this.value.getStringValue();
}
/**
* Sets from string value.
*
* @param value the value
*/
public void setFromStringValue(String value) {
this.value.toStringValue(value);
}
/**
* Gets value type.
*
* @return the value type
*/
public String getValueType() {
return this.value.getType();
}
}