@SuppressWarnings("unchecked") private <T> T getProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); Object property = properties.get(key); return (T) (property != null ? property : key.getDefaultValue()); }
@SuppressWarnings("unchecked") private <T> T getProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); Object property = properties.get(key); return (T) (property != null ? property : key.getDefaultValue()); }
@SuppressWarnings("unchecked") private <T> T getProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); Object property = properties.get(key); return (T) (property != null ? property : key.getDefaultValue()); }
@SuppressWarnings("unchecked") private <T> T getProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); Object property = properties.get(key); return (T) (property != null ? property : key.getDefaultValue()); }
@SuppressWarnings("unchecked") private <T> T getProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); Object property = properties.get(key); return (T) (property != null ? property : key.getDefaultValue()); }
@SuppressWarnings("unchecked") private <T> T getProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); Object property = properties.get(key); return (T) (property != null ? property : key.getDefaultValue()); }
/** * * @param key * @param requiredType * @throws IllegalStateException If the configuration property type does not match the required type */ static void checkRequiredType(ConfigurationKey key, Class<?> requiredType) { if (!key.isValidValueType(requiredType)) { throw ConfigurationLogger.LOG.configurationPropertyTypeMismatch(key.getDefaultValue().getClass(), requiredType, key.get()); } }
/** * * @param key * @param requiredType * @throws IllegalStateException If the configuration property type does not match the required type */ static void checkRequiredType(ConfigurationKey key, Class<?> requiredType) { if (!key.isValidValueType(requiredType)) { throw ConfigurationLogger.LOG.configurationPropertyTypeMismatch(key.getDefaultValue().getClass(), requiredType, key.get()); } }
/** * * @param key * @param requiredType * @throws IllegalStateException If the configuration property type does not match the required type */ static void checkRequiredType(ConfigurationKey key, Class<?> requiredType) { if (!key.isValidValueType(requiredType)) { throw ConfigurationLogger.LOG.configurationPropertyTypeMismatch(key.getDefaultValue().getClass(), requiredType, key.get()); } }
/** * * @param key * @param requiredType * @throws IllegalStateException If the configuration property type does not match the required type */ static void checkRequiredType(ConfigurationKey key, Class<?> requiredType) { if (!key.isValidValueType(requiredType)) { throw ConfigurationLogger.LOG.configurationPropertyTypeMismatch(key.getDefaultValue().getClass(), requiredType, key.get()); } }
/** * * @param key * @param requiredType * @throws IllegalStateException If the configuration property type does not match the required type */ static void checkRequiredType(ConfigurationKey key, Class<?> requiredType) { if (!key.isValidValueType(requiredType)) { throw ConfigurationLogger.LOG.configurationPropertyTypeMismatch(key.getDefaultValue().getClass(), requiredType, key.get()); } }
/** * * @param key * @param requiredType * @throws IllegalStateException If the configuration property type does not match the required type */ static void checkRequiredType(ConfigurationKey key, Class<?> requiredType) { if (!key.isValidValueType(requiredType)) { throw ConfigurationLogger.LOG.configurationPropertyTypeMismatch(key.getDefaultValue().getClass(), requiredType, key.get()); } }
@SuppressWarnings("unchecked") private <T> T initSystemProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); String property = getSystemProperty(key.get()); return (T) (property != null ? key.convertValue(property) : key.getDefaultValue()); }
@SuppressWarnings("unchecked") private <T> T initSystemProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); String property = getSystemProperty(key.get()); return (T) (property != null ? key.convertValue(property) : key.getDefaultValue()); }
@SuppressWarnings("unchecked") private <T> T initSystemProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); String property = getSystemProperty(key.get()); return (T) (property != null ? key.convertValue(property) : key.getDefaultValue()); }
@SuppressWarnings("unchecked") private <T> T initSystemProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); String property = getSystemProperty(key.get()); return (T) (property != null ? key.convertValue(property) : key.getDefaultValue()); }
@SuppressWarnings("unchecked") private <T> T initSystemProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); String property = getSystemProperty(key.get()); return (T) (property != null ? key.convertValue(property) : key.getDefaultValue()); }
@SuppressWarnings("unchecked") private <T> T initSystemProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); String property = getSystemProperty(key.get()); return (T) (property != null ? key.convertValue(property) : key.getDefaultValue()); }
static Object getValue(ConfigurationKey key, WeldConfiguration configuration) { Object defaultValue = key.getDefaultValue(); Object value = null; if (defaultValue instanceof Boolean) { value = configuration.getBooleanProperty(key); } else if (defaultValue instanceof Long) { value = configuration.getLongProperty(key); } else if (defaultValue instanceof Integer) { value = configuration.getIntegerProperty(key); } else if (defaultValue instanceof String) { value = configuration.getStringProperty(key); } return value; }
static Object getValue(ConfigurationKey key, WeldConfiguration configuration) { Object defaultValue = key.getDefaultValue(); Object value = null; if (defaultValue instanceof Boolean) { value = configuration.getBooleanProperty(key); } else if (defaultValue instanceof Long) { value = configuration.getLongProperty(key); } else if (defaultValue instanceof Integer) { value = configuration.getIntegerProperty(key); } else if (defaultValue instanceof String) { value = configuration.getStringProperty(key); } return value; }