de.customed.plugins.internal.ConfigurableExtension Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plugin-api Show documentation
Show all versions of plugin-api Show documentation
custo diagnostic server by custo med is part of the custo diagnostic medical product.
In custo diagnostic, the entire cardiopulmonary functional diagnostics is integrated in one consistent
and modular user interface. Our central software platform allows you to work consistently in all
applications - from the single-user workstation to the multi-site solution.
The newest version!
package de.customed.plugins.internal;
import de.customed.diag.shared.dto.ConfigValueDTO;
import de.customed.diag.shared.enums.DataTypes;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
/*
* Extension class to allow Extensions to be configurable by PluginService.
*/
public class ConfigurableExtension {
List config = new ArrayList<>();
{
config.add(new ConfigValueDTO("debug", "Debug", DataTypes.BOOLEAN, "false"));
}
public ConfigurableExtension(ConfigValueDTO ... args){
config.addAll(Arrays.asList(args));
}
public void setConfig(List config) {
this.config = config;
}
public List getConfig() {
return config;
}
public boolean isDebug(){
Optional debugConfig = config.stream().filter(c->c.getName().equals("debug")).findFirst();
return debugConfig.isPresent() && debugConfig.get().getValue().equalsIgnoreCase("true");
}
}