Here you can find the source of negateIfTrue(final boolean condition, final BigDecimal value)
public static BigDecimal negateIfTrue(final boolean condition, final BigDecimal value)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { /**/*w ww . ja v a2s.c o m*/ * Returns the negate of the value if condition is true, handles null. */ public static BigDecimal negateIfTrue(final boolean condition, final BigDecimal value) { return condition ? negate(value) : value; } /** * Returns the negate of the value, handles null. */ public static BigDecimal negate(final BigDecimal value) { return value != null ? value.negate() : null; } }