@Override public String getRequiredProperty(String key) throws IllegalStateException { return getRequiredProperty(key, String.class); }
/** * Return a Map of all values from the specified {@link PropertySources} that start * with a particular key. * @param propertySources the property sources to scan * @param keyPrefix the key prefixes to test * @return a map of all sub properties starting with the specified key prefixes. * @see PropertySourceUtils#getSubProperties(PropertySources, String, String) */ public static Map<String, Object> getSubProperties(PropertySources propertySources, String keyPrefix) { return PropertySourceUtils.getSubProperties(propertySources, null, keyPrefix); }
@Override public String getProperty(String key) { return getProperty(key, String.class, null); }
@Override protected boolean isEnabled() { return new RelaxedPropertyResolver(getEnvironment()).getProperty(CacheConstant.CACHE_ENABLED, Boolean.class, Boolean.TRUE); } }
private void initialize(String name, Set<String> values) { if (values.contains(name)) { return; } for (Variation variation : Variation.values()) { for (Manipulation manipulation : Manipulation.values()) { String result = name; result = manipulation.apply(result); result = variation.apply(result); values.add(result); initialize(result, values); } } }
/** * Create a new {@link RelaxedNames} instance. * @param name the source name. For the maximum number of variations specify the name * using dashed notation (e.g. {@literal my-property-name} */ public RelaxedNames(String name) { this.name = (name != null ? name : ""); initialize(RelaxedNames.this.name, this.values); }
@Override public <T> T getProperty(String key, Class<T> targetType, T defaultValue) { RelaxedNames prefixes = new RelaxedNames(this.prefix); RelaxedNames keys = new RelaxedNames(key); for (String prefix : prefixes) { for (String relaxedKey : keys) { if (this.resolver.containsProperty(prefix + relaxedKey)) { return this.resolver.getProperty(prefix + relaxedKey, targetType); } } } return defaultValue; }
@Override protected boolean isEnabled() { return new RelaxedPropertyResolver(getEnvironment()).getProperty(CacheConstant.CACHE_ENABLED, Boolean.class, Boolean.TRUE); } }
@Override public String getProperty(String key, String defaultValue) { return getProperty(key, String.class, defaultValue); }
@Override protected boolean isEnabled() { return new RelaxedPropertyResolver(getEnvironment()).getProperty(LimitConstant.LIMIT_ENABLED, Boolean.class, Boolean.TRUE); } }
@Override public <T> T getProperty(String key, Class<T> targetType) { return getProperty(key, targetType, null); }
@Override protected boolean isEnabled() { return new RelaxedPropertyResolver(getEnvironment()).getProperty(EventConstant.EVENTBUS_ENABLED, Boolean.class, Boolean.TRUE); } }
@Override protected boolean isEnabled() { return new RelaxedPropertyResolver(getEnvironment()).getProperty(IdGeneratorConstant.IDGENERATOR_ENABLED, Boolean.class, Boolean.TRUE); } }
@Override protected boolean isEnabled() { return new RelaxedPropertyResolver(getEnvironment()).getProperty(IdGeneratorConstant.IDGENERATOR_ENABLED, Boolean.class, Boolean.TRUE); } }
@Override protected boolean isEnabled() { return new RelaxedPropertyResolver(getEnvironment()).getProperty(IdGeneratorConstant.IDGENERATOR_ENABLED, Boolean.class, Boolean.TRUE); } }
@Override protected boolean isEnabled() { return new RelaxedPropertyResolver(getEnvironment()).getProperty(LockConstant.LOCK_ENABLED, Boolean.class, Boolean.TRUE); } }
@Override protected boolean isEnabled() { return new RelaxedPropertyResolver(getEnvironment()).getProperty(PermissionServiceConstant.PERMISSION_SERVICE_ENABLED, Boolean.class, Boolean.TRUE); } }
@Override protected boolean isEnabled() { return new RelaxedPropertyResolver(getEnvironment()).getProperty(PermissionFeignConstant.PERMISSION_FEIGN_ENABLED, Boolean.class, Boolean.TRUE); } }
@Override protected boolean isEnabled() { return new RelaxedPropertyResolver(getEnvironment()).getProperty(SkeletonConstant.SKELETON_ENABLED, Boolean.class, Boolean.TRUE); } }
@Override protected boolean isEnabled() { return new RelaxedPropertyResolver(getEnvironment()).getProperty(PermissionConstant.PERMISSION_ENABLED, Boolean.class, Boolean.TRUE); } }