/** * Read property as <code>Integer</code>. * * @param propertyName name of property. * @return property as <code>Integer</code>. */ public static Integer pInteger(String propertyName){ return Convert.toInteger(p(propertyName)); }
public RedisCacheManager() { try { String host = p("redis.cache.manager.host"); String port = p("redis.cache.manager.port"); jedisPool = blank(host) || blank(port) ? new JedisPool() : new JedisPool(host,toInteger(port)); } catch (Exception e) { throw new InitException("Failed to configure connection to Redis server", e); } }
/** * Sets attribute value as <code>Integer</code>. * If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class * <code>java.lang.Integer</code>, given the value is an instance of <code>S</code>, then it will be used, * otherwise performs a conversion using {@link Convert#toInteger(Object)}. * * @param attributeName name of attribute. * @param value value * @return reference to this model. */ public <T extends Model> T setInteger(String attributeName, Object value) { Converter<Object, Integer> converter = modelRegistryLocal.converterForValue(attributeName, value, Integer.class); return setRaw(attributeName, converter != null ? converter.convert(value) : Convert.toInteger(value)); }
/** * Gets attribute value as <code>Integer</code>. * If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class * <code>java.lang.Integer</code>, given the attribute value is an instance of <code>S</code>, then it will be used, * otherwise performs a conversion using {@link Convert#toInteger(Object)}. * * @param attributeName name of attribute to convert * @return value converted to <code>Integer</code> */ public Integer getInteger(String attributeName) { Object value = getRaw(attributeName); Converter<Object, Integer> converter = modelRegistryLocal.converterForValue(attributeName, value, Integer.class); return converter != null ? converter.convert(value) : Convert.toInteger(value); }
/** * int value assigned by controller. * * @param name name of a value assigned by controller. * @return a single value assigned by controller. */ protected int valInteger(String name){ assert name != null; return Convert.toInteger(val(name)); }
/** * Convenience method, returns object from session, equivalent of: * <pre> * <code> * Integer val = (Integer)session().get(name) * </code> * </pre> * * @param name name of object * @return value */ protected Integer sessionInteger(String name){ return Convert.toInteger(session(name)); }
/** * Convenience method, returns object from session, equivalent of: * <pre> * <code> * Integer val = (Integer)session().get(name) * </code> * </pre> * * @param name name of object * @return value */ protected Integer sessionInteger(String name){ return Convert.toInteger(session().get(name)); }
public RedisCacheManager() { try { String host = p("redis.cache.manager.host"); String port = p("redis.cache.manager.port"); jedisPool = blank(host) || blank(port) ? new JedisPool() : new JedisPool(host,toInteger(port)); } catch (Exception e) { throw new InitException("Failed to configure connection to Redis server", e); } }
/** * Sets attribute value as <code>Integer</code>. * If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class * <code>java.lang.Integer</code>, given the value is an instance of <code>S</code>, then it will be used, * otherwise performs a conversion using {@link Convert#toInteger(Object)}. * * @param attributeName name of attribute. * @param value value * @return reference to this model. */ public <T extends Model> T setInteger(String attributeName, Object value) { Converter<Object, Integer> converter = modelRegistryLocal().converterForValue(attributeName, value, Integer.class); return setRaw(attributeName, converter != null ? converter.convert(value) : Convert.toInteger(value)); }
/** * Gets attribute value as <code>Integer</code>. * If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class * <code>java.lang.Integer</code>, given the attribute value is an instance of <code>S</code>, then it will be used, * otherwise performs a conversion using {@link Convert#toInteger(Object)}. * * @param attributeName name of attribute to convert * @return value converted to <code>Integer</code> */ public Integer getInteger(String attributeName) { Object value = getRaw(attributeName); Converter<Object, Integer> converter = modelRegistryLocal().converterForValue(attributeName, value, Integer.class); return converter != null ? converter.convert(value) : Convert.toInteger(value); }
/** * Sets attribute value as <code>Integer</code>. * If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class * <code>java.lang.Integer</code>, given the value is an instance of <code>S</code>, then it will be used, * otherwise performs a conversion using {@link Convert#toInteger(Object)}. * * @param attributeName name of attribute. * @param value value * @return reference to this model. */ public <T extends Model> T setInteger(String attributeName, Object value) { Converter<Object, Integer> converter = modelRegistryLocal().converterForValue(attributeName, value, Integer.class); return setRaw(attributeName, converter != null ? converter.convert(value) : Convert.toInteger(value)); }
/** * Gets attribute value as <code>Integer</code>. * If there is a {@link Converter} registered for the attribute that converts from Class <code>S</code> to Class * <code>java.lang.Integer</code>, given the attribute value is an instance of <code>S</code>, then it will be used, * otherwise performs a conversion using {@link Convert#toInteger(Object)}. * * @param attributeName name of attribute to convert * @return value converted to <code>Integer</code> */ public Integer getInteger(String attributeName) { Object value = getRaw(attributeName); Converter<Object, Integer> converter = modelRegistryLocal().converterForValue(attributeName, value, Integer.class); return converter != null ? converter.convert(value) : Convert.toInteger(value); }