/** * Sets attribute value as <code>java.math.BigDecimal</code>. * If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class * <code>java.math.BigDecimal</code>, given the value is an instance of <code>S</code>, then it will be used, * otherwise performs a conversion using {@link Convert#toBigDecimal(Object)}. * * @param attributeName name of attribute. * @param value value * @return reference to this model. */ public <T extends Model> T setBigDecimal(String attributeName, Object value) { Converter<Object, BigDecimal> converter = modelRegistryLocal.converterForValue( attributeName, value, BigDecimal.class); return setRaw(attributeName, converter != null ? converter.convert(value) : Convert.toBigDecimal(value)); }
/** * Gets attribute value as <code>java.math.BigDecimal</code>. * If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class * <code>java.math.BigDecimal</code>, given the attribute value is an instance of <code>S</code>, then it will be * used, otherwise performs a conversion using {@link Convert#toBigDecimal(Object)}. * * @param attributeName name of attribute to convert * @return value converted to <code>java.math.BigDecimal</code> */ public BigDecimal getBigDecimal(String attributeName) { Object value = getRaw(attributeName); Converter<Object, BigDecimal> converter = modelRegistryLocal.converterForValue( attributeName, value, BigDecimal.class); return converter != null ? converter.convert(value) : Convert.toBigDecimal(value); }
/** * Gets attribute value as <code>java.math.BigDecimal</code>. * If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class * <code>java.math.BigDecimal</code>, given the attribute value is an instance of <code>S</code>, then it will be * used, otherwise performs a conversion using {@link Convert#toBigDecimal(Object)}. * * @param attributeName name of attribute to convert * @return value converted to <code>java.math.BigDecimal</code> */ public BigDecimal getBigDecimal(String attributeName) { Object value = getRaw(attributeName); Converter<Object, BigDecimal> converter = modelRegistryLocal().converterForValue( attributeName, value, BigDecimal.class); return converter != null ? converter.convert(value) : Convert.toBigDecimal(value); }
/** * Sets attribute value as <code>java.math.BigDecimal</code>. * If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class * <code>java.math.BigDecimal</code>, given the value is an instance of <code>S</code>, then it will be used, * otherwise performs a conversion using {@link Convert#toBigDecimal(Object)}. * * @param attributeName name of attribute. * @param value value * @return reference to this model. */ public <T extends Model> T setBigDecimal(String attributeName, Object value) { Converter<Object, BigDecimal> converter = modelRegistryLocal().converterForValue( attributeName, value, BigDecimal.class); return setRaw(attributeName, converter != null ? converter.convert(value) : Convert.toBigDecimal(value)); }
/** * Gets attribute value as <code>java.math.BigDecimal</code>. * If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class * <code>java.math.BigDecimal</code>, given the attribute value is an instance of <code>S</code>, then it will be * used, otherwise performs a conversion using {@link Convert#toBigDecimal(Object)}. * * @param attributeName name of attribute to convert * @return value converted to <code>java.math.BigDecimal</code> */ public BigDecimal getBigDecimal(String attributeName) { Object value = getRaw(attributeName); Converter<Object, BigDecimal> converter = modelRegistryLocal().converterForValue( attributeName, value, BigDecimal.class); return converter != null ? converter.convert(value) : Convert.toBigDecimal(value); }
/** * Sets attribute value as <code>java.math.BigDecimal</code>. * If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class * <code>java.math.BigDecimal</code>, given the value is an instance of <code>S</code>, then it will be used, * otherwise performs a conversion using {@link Convert#toBigDecimal(Object)}. * * @param attributeName name of attribute. * @param value value * @return reference to this model. */ public <T extends Model> T setBigDecimal(String attributeName, Object value) { Converter<Object, BigDecimal> converter = modelRegistryLocal().converterForValue( attributeName, value, BigDecimal.class); return setRaw(attributeName, converter != null ? converter.convert(value) : Convert.toBigDecimal(value)); }