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

cdm.product.asset.functions.DividendCashSettlementAmount Maven / Gradle / Ivy

There is a newer version: 6.0.0-dev.89
Show newest version
package cdm.product.asset.functions;

import com.google.inject.ImplementedBy;
import com.rosetta.model.lib.expression.MapperMaths;
import com.rosetta.model.lib.functions.RosettaFunction;
import com.rosetta.model.lib.mapper.MapperS;
import java.math.BigDecimal;


@ImplementedBy(DividendCashSettlementAmount.DividendCashSettlementAmountDefault.class)
public abstract class DividendCashSettlementAmount implements RosettaFunction {

	/**
	* @param numberOfSecurities 
	* @param declaredDividend 
	* @return dividendCashSettlementAmount 
	*/
	public BigDecimal evaluate(BigDecimal numberOfSecurities, BigDecimal declaredDividend) {
		BigDecimal dividendCashSettlementAmount = doEvaluate(numberOfSecurities, declaredDividend);
		
		return dividendCashSettlementAmount;
	}

	protected abstract BigDecimal doEvaluate(BigDecimal numberOfSecurities, BigDecimal declaredDividend);

	public static class DividendCashSettlementAmountDefault extends DividendCashSettlementAmount {
		@Override
		protected BigDecimal doEvaluate(BigDecimal numberOfSecurities, BigDecimal declaredDividend) {
			BigDecimal dividendCashSettlementAmount = null;
			return assignOutput(dividendCashSettlementAmount, numberOfSecurities, declaredDividend);
		}
		
		protected BigDecimal assignOutput(BigDecimal dividendCashSettlementAmount, BigDecimal numberOfSecurities, BigDecimal declaredDividend) {
			dividendCashSettlementAmount = MapperMaths.multiply(MapperS.of(declaredDividend), MapperS.of(numberOfSecurities)).get();
			
			return dividendCashSettlementAmount;
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy