com.rosetta.metatest.model.util.PriceQuantity11DeepPathUtil Maven / Gradle / Ivy
package com.rosetta.metatest.model.util;
import com.rosetta.metatest.model.Observable11;
import com.rosetta.metatest.model.PriceQuantity11;
import com.rosetta.metatest.model.metafields.FieldWithMetaObservable11;
import com.rosetta.model.lib.mapper.MapperS;
import java.math.BigDecimal;
import static com.rosetta.model.lib.expression.ExpressionOperators.*;
public class PriceQuantity11DeepPathUtil {
public BigDecimal chooseAmount(PriceQuantity11 priceQuantity11) {
final MapperS observable11 = MapperS.of(priceQuantity11).map("getObservable11", _priceQuantity11 -> _priceQuantity11.getObservable11()).map("getValue", _f->_f.getValue());
if (exists(observable11).getOrDefault(false)) {
return observable11.map("getAmount", _observable11 -> _observable11.getAmount()).get();
}
return null;
}
public Observable11 chooseObservable11(PriceQuantity11 priceQuantity11) {
final MapperS observable11 = MapperS.of(priceQuantity11).map("getObservable11", _priceQuantity11 -> _priceQuantity11.getObservable11()).map("getValue", _f->_f.getValue());
if (exists(observable11).getOrDefault(false)) {
return observable11.get();
}
return null;
}
}