You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
2.7 KiB
86 lines
2.7 KiB
4 years ago
|
package com.fr.plugin.config;
|
||
|
|
||
|
import com.fr.config.*;
|
||
|
import com.fr.config.holder.Conf;
|
||
|
import com.fr.config.holder.factory.Holders;
|
||
|
import com.fr.stable.StringUtils;
|
||
|
|
||
|
@Visualization(category = "Plugin-Config_Demo")
|
||
|
public class MySimpleConfig extends DefaultConfiguration {
|
||
|
private static volatile MySimpleConfig config = null;
|
||
|
|
||
|
public static MySimpleConfig getInstance() {
|
||
|
if (config == null) {
|
||
|
config = ConfigContext.getConfigInstance(MySimpleConfig.class);
|
||
|
}
|
||
|
return config;
|
||
|
}
|
||
|
|
||
|
|
||
|
@Identifier(value = "text", name = "Plugin-Config_Property_Text", description = "Plugin-Config_Property_Text_Description", status = Status.SHOW)
|
||
|
private Conf<String> text = Holders.simple(StringUtils.EMPTY);
|
||
|
|
||
|
@Identifier(value = "count", name = "Plugin-Config_Property_Count", description = "Plugin-Config_Property_Count_Description", status = Status.SHOW)
|
||
|
private Conf<Integer> count = Holders.simple(100);
|
||
|
|
||
|
@Identifier(value = "price", name = "Plugin-Config_Property_Price", description = "Plugin-Config_Property_Price_Description", status = Status.SHOW)
|
||
|
private Conf<Double> price = Holders.simple(1000.0);
|
||
|
|
||
|
@Identifier(value = "time", name = "Plugin-Config_Property_Time", description = "Plugin-Config_Property_Time_Description", status = Status.SHOW)
|
||
|
private Conf<Long> time = Holders.simple(99999999L);
|
||
|
|
||
|
@Identifier(value = "student", name = "Plugin-Config_Property_Student", description = "Plugin-Config_Property_Student_Description", status = Status.SHOW)
|
||
|
private Conf<Boolean> student = Holders.simple(true);
|
||
|
|
||
|
public String getText() {
|
||
|
return text.get();
|
||
|
}
|
||
|
|
||
|
public void setText(String text) {
|
||
|
this.text.set(text);
|
||
|
}
|
||
|
|
||
|
public Integer getCount() {
|
||
|
return count.get();
|
||
|
}
|
||
|
|
||
|
public void setCount(Integer count) {
|
||
|
this.count.set(count);
|
||
|
}
|
||
|
|
||
|
public Double getPrice() {
|
||
|
return price.get();
|
||
|
}
|
||
|
|
||
|
public void setPrice(Double price) {
|
||
|
this.price.set(price);
|
||
|
}
|
||
|
|
||
|
public Long getTime() {
|
||
|
return time.get();
|
||
|
}
|
||
|
|
||
|
public void setTime(Long time) {
|
||
|
this.time.set(time);
|
||
|
}
|
||
|
|
||
|
public Boolean getStudent() {
|
||
|
return student.get();
|
||
|
}
|
||
|
|
||
|
public void setStudent(Boolean student) {
|
||
|
this.student.set(student);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public Object clone() throws CloneNotSupportedException {
|
||
|
MySimpleConfig cloned = (MySimpleConfig) super.clone();
|
||
|
cloned.text = (Conf<String>) text.clone();
|
||
|
cloned.count = (Conf<Integer>) count.clone();
|
||
|
cloned.price = (Conf<Double>) price.clone();
|
||
|
cloned.time = (Conf<Long>) time.clone();
|
||
|
cloned.student = (Conf<Boolean>) student.clone();
|
||
|
return cloned;
|
||
|
}
|
||
|
}
|