-
public class VolatileConfig extends MutableConfig
Created by vincent on 18-1-17. Copyright @ 2013-2017 Platon AI. All rights reserved
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classVolatileConfig.Companion
-
Field Summary
Fields Modifier and Type Field Description private ImmutableConfigfallbackConfigprivate final Map<String, Object>variablesprivate Stringnameprivate Stringprofileprivate final Stringmodeprivate Environmentenvironmentprivate final BooleanisDryRunprivate final BooleanisDistributedFs
-
Constructor Summary
Constructors Constructor Description VolatileConfig()VolatileConfig(Boolean loadDefaults)VolatileConfig(String profile, Boolean loadDefaults, Iterable<String> resources)VolatileConfig(ImmutableConfig fallbackConfig)
-
Method Summary
Modifier and Type Method Description final ImmutableConfiggetFallbackConfig()final UnitsetFallbackConfig(ImmutableConfig fallbackConfig)final Map<String, Object>getVariables()final StringgetName()final UnitsetName(String name)final StringgetProfile()final UnitsetProfile(String profile)final StringgetMode()final EnvironmentgetEnvironment()Spring core is the first class dependency now, we will remove dependency on KConfiguration later final UnitsetEnvironment(Environment environment)Spring core is the first class dependency now, we will remove dependency on KConfiguration later final BooleangetIsDryRun()final BooleangetIsDistributedFs()final Unitreset()Stringget(String name, String defaultValue)Get the value of the name.Stringget(String name)Get the value of the nameproperty,nullif no such property exists.final Unitset(String name, String value, Integer ttl)final StringgetAndSet(String name, String value, Integer ttl)final IntegergetTTL(String name)UnitsetTTL(String name, Integer ttl)final <T extends Any> ObjectputBean(T bean)final <T extends Any> ObjectputBean(String name, T bean)final <T extends Any> TgetBean(Class<T> bean)final <T extends Any> TgetBean(KClass<T> bean)final <T extends Any> TgetBean(String name, Class<T> bean)final <T extends Any> TgetBean(String name, KClass<T> bean)final <T extends Any> ObjectremoveBean(T bean)final <T extends Any> ObjectremoveBean(String name)final ObjectgetVariable(String name)final UnitsetVariable(String name, Object value)BooleanisExpired(String key)-
Methods inherited from class ai.platon.pulsar.common.config.VolatileConfig
clear, getAndSet, getAndUnset, merge, reset, set, setBoolean, setBooleanIfUnset, setDouble, setDuration, setEnum, setFloat, setIfNotEmpty, setIfNotNull, setInstant, setInt, setLong, setStrings, toVolatileConfig, unset -
Methods inherited from class ai.platon.pulsar.common.config.MutableConfig
toMutableConfig -
Methods inherited from class ai.platon.pulsar.common.config.ImmutableConfig
getBoolean, getClass, getClass, getConfResourceAsInputStream, getConfResourceAsReader, getDouble, getDuration, getDuration, getEnum, getFloat, getInstant, getInt, getInts, getKvs, getLong, getPath, getPathOrNull, getResource, getStringCollection, getStrings, getStrings, getTrimmedStringCollection, getTrimmedStrings, getTrimmedStrings, getUint, getUlong, size, toString, unbox -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getFallbackConfig
final ImmutableConfig getFallbackConfig()
-
setFallbackConfig
final Unit setFallbackConfig(ImmutableConfig fallbackConfig)
-
getVariables
final Map<String, Object> getVariables()
-
getProfile
final String getProfile()
-
setProfile
final Unit setProfile(String profile)
-
getEnvironment
final Environment getEnvironment()
Spring core is the first class dependency now, we will remove dependency on KConfiguration later
-
setEnvironment
final Unit setEnvironment(Environment environment)
Spring core is the first class dependency now, we will remove dependency on KConfiguration later
-
getIsDryRun
final Boolean getIsDryRun()
-
getIsDistributedFs
final Boolean getIsDistributedFs()
-
get
String get(String name, String defaultValue)
Get the value of the
name. If the key is deprecated, it returns the value of the first key which replaces the deprecated key and is not null. If no such property exists, thendefaultValueis returned.- Parameters:
name- property name, will be trimmed before get value.defaultValue- default value.
-
get
String get(String name)
Get the value of the
nameproperty,nullif no such property exists. If the key is deprecated, it returns the value of the first key which replaces the deprecated key and is not null.Values are processed for #VariableExpansion before being returned.
- Parameters:
name- the property name, will be trimmed before get value.
-
removeBean
final <T extends Any> Object removeBean(T bean)
-
removeBean
final <T extends Any> Object removeBean(String name)
-
getVariable
final Object getVariable(String name)
-
setVariable
final Unit setVariable(String name, Object value)
-
-
-
-