use of org.cerberus.crud.entity.Parameter in project cerberus-source by cerberustesting.
the class FactoryParameter method create.
@Override
public Parameter create(String system, String param, String value, String description) {
Parameter parameter = new Parameter();
parameter.setSystem(system);
parameter.setParam(param);
parameter.setValue(value);
parameter.setDescription(description);
return parameter;
}
use of org.cerberus.crud.entity.Parameter in project cerberus-source by cerberustesting.
the class ParameterService method getParameterBooleanByKey.
@Override
public boolean getParameterBooleanByKey(String key, String system, boolean defaultValue) {
Parameter myParameter;
boolean outPutResult = defaultValue;
try {
myParameter = this.findParameterByKey(key, system);
outPutResult = StringUtil.parseBoolean(myParameter.getValue());
} catch (CerberusException | NumberFormatException ex) {
LOG.error("Error when trying to retreive parameter : '" + key + "' for system : '" + system + "'. Default value returned : '" + defaultValue + "'. Trace : " + ex);
}
LOG.debug("Success loading parameter : '" + key + "' for system : '" + system + "'. Value returned : '" + outPutResult + "'");
return outPutResult;
}
use of org.cerberus.crud.entity.Parameter in project cerberus-source by cerberustesting.
the class ParameterService method getParameterFloatByKey.
@Override
public float getParameterFloatByKey(String key, String system, float defaultValue) {
Parameter myParameter;
float outPutResult = defaultValue;
try {
myParameter = this.findParameterByKey(key, system);
outPutResult = Float.valueOf(myParameter.getValue());
} catch (CerberusException | NumberFormatException ex) {
LOG.error("Error when trying to retreive parameter : '" + key + "' for system : '" + system + "'. Default value returned : '" + defaultValue + "'. Trace : " + ex);
}
LOG.debug("Success loading parameter : '" + key + "' for system : '" + system + "'. Value returned : '" + outPutResult + "'");
return outPutResult;
}
use of org.cerberus.crud.entity.Parameter in project cerberus-source by cerberustesting.
the class ParameterService method getParameterIntegerByKey.
@Override
public Integer getParameterIntegerByKey(String key, String system, Integer defaultValue) {
Parameter myParameter;
Integer outPutResult = defaultValue;
try {
myParameter = this.findParameterByKey(key, system);
outPutResult = Integer.valueOf(myParameter.getValue());
} catch (CerberusException | NumberFormatException ex) {
LOG.error("Error when trying to retreive parameter : '" + key + "' for system : '" + system + "'. Default value returned : '" + defaultValue + "'. Trace : " + ex);
}
LOG.debug("Success loading parameter : '" + key + "' for system : '" + system + "'. Value returned : '" + outPutResult + "'");
return outPutResult;
}
use of org.cerberus.crud.entity.Parameter in project cerberus-source by cerberustesting.
the class ParameterService method getParameterStringByKey.
@Override
public String getParameterStringByKey(String key, String system, String defaultValue) {
Parameter myParameter;
String outPutResult = defaultValue;
try {
myParameter = this.findParameterByKey(key, system);
outPutResult = myParameter.getValue();
} catch (CerberusException ex) {
LOG.error("Error when trying to retreive parameter : '" + key + "' for system : '" + system + "'. Default value returned : '" + defaultValue + "'. Trace : " + ex);
}
LOG.debug("Success loading parameter : '" + key + "' for system : '" + system + "'. Value returned : '" + outPutResult + "'");
return outPutResult;
}
Aggregations