All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.tsl2.nano.cursus.effectus.RuleEffectus Maven / Gradle / Ivy

The newest version!
package de.tsl2.nano.cursus.effectus;

import de.tsl2.nano.bean.BeanUtil;
import de.tsl2.nano.core.ENV;
import de.tsl2.nano.cursus.Res;
import de.tsl2.nano.specification.Pool;

public class RuleEffectus extends Effectus {
	private static final long serialVersionUID = 1L;

	private String ruleName;

	public RuleEffectus() {
	}

	public RuleEffectus(Res res, boolean fixed, String ruleName) {
		super(res, fixed);
		this.ruleName = ruleName;
	}

	@SuppressWarnings("unchecked")
	@Override
	protected V evaluateNewValue() {
		return (V) ENV.get(Pool.class).get(ruleName).run(BeanUtil.toValueMap(getItem()));
	}

	public String getRuleName() {
		return ruleName;
	}

	public void setRuleName(String ruleName) {
		this.ruleName = ruleName;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy