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

com.rosetta.metatest.model.util.Asset14DeepPathUtil Maven / Gradle / Ivy

There is a newer version: 11.25.1
Show newest version
package com.rosetta.metatest.model.util;

import com.rosetta.metatest.model.Asset14;
import com.rosetta.metatest.model.Instrument14;
import com.rosetta.model.lib.mapper.MapperS;
import java.math.BigDecimal;

import static com.rosetta.model.lib.expression.ExpressionOperators.*;

public class Asset14DeepPathUtil {
	public BigDecimal chooseAmount(Asset14 asset14) {
		final MapperS instrument14 = MapperS.of(asset14).map("getInstrument14", _asset14 -> _asset14.getInstrument14());
		if (exists(instrument14).getOrDefault(false)) {
			return instrument14.map("getAmount", _instrument14 -> _instrument14.getAmount()).get();
		}
		return null;
	}
	
	public Instrument14 chooseInstrument14(Asset14 asset14) {
		final MapperS instrument14 = MapperS.of(asset14).map("getInstrument14", _asset14 -> _asset14.getInstrument14());
		if (exists(instrument14).getOrDefault(false)) {
			return instrument14.get();
		}
		return null;
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy