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