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

com.rosetta.metatest.model.util.Observable13_2DeepPathUtil 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_2;
import com.rosetta.metatest.model.Observable13_2;
import com.rosetta.metatest.model.metafields.FieldWithMetaAsset13_2;
import com.rosetta.model.lib.mapper.MapperS;
import java.math.BigDecimal;

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

public class Observable13_2DeepPathUtil {
	public Asset13_2 chooseAsset13_2(Observable13_2 observable13_2) {
		final MapperS asset13_2 = MapperS.of(observable13_2).map("getAsset13_2", _observable13_2 -> _observable13_2.getAsset13_2()).map("getValue", _f->_f.getValue());
		if (exists(asset13_2).getOrDefault(false)) {
			return asset13_2.get();
		}
		return null;
	}
	
	public BigDecimal chooseAmount(Observable13_2 observable13_2) {
		final MapperS asset13_2 = MapperS.of(observable13_2).map("getAsset13_2", _observable13_2 -> _observable13_2.getAsset13_2()).map("getValue", _f->_f.getValue());
		if (exists(asset13_2).getOrDefault(false)) {
			return asset13_2.map("getAmount", _asset13_2 -> _asset13_2.getAmount()).get();
		}
		return null;
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy