com.rosetta.metatest.model.util.Observable13DeepPathUtil Maven / Gradle / Ivy
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;
}
}