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

com.rosetta.metatest.model.util.Observable13DeepPathUtil 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.Asset13;
import com.rosetta.metatest.model.Observable13;
import com.rosetta.metatest.model.metafields.FieldWithMetaAsset13;
import com.rosetta.model.lib.mapper.MapperS;
import java.math.BigDecimal;

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

public class Observable13DeepPathUtil {
	public BigDecimal chooseAmount(Observable13 observable13) {
		final MapperS asset13 = MapperS.of(observable13).map("getAsset13", _observable13 -> _observable13.getAsset13()).map("getValue", _f->_f.getValue());
		if (exists(asset13).getOrDefault(false)) {
			return asset13.map("getAmount", _asset13 -> _asset13.getAmount()).get();
		}
		return null;
	}
	
	public Asset13 chooseAsset13(Observable13 observable13) {
		final MapperS asset13 = MapperS.of(observable13).map("getAsset13", _observable13 -> _observable13.getAsset13()).map("getValue", _f->_f.getValue());
		if (exists(asset13).getOrDefault(false)) {
			return asset13.get();
		}
		return null;
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy