Class DefaultPropertyResolverRegistry
- java.lang.Object
-
- com.hybris.cockpitng.core.util.impl.DefaultPropertyResolverRegistry
-
- All Implemented Interfaces:
CockpitProperties
public class DefaultPropertyResolverRegistry extends java.lang.Object implements CockpitProperties
-
-
Constructor Summary
Constructors Constructor Description DefaultPropertyResolverRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleangetBoolean(java.lang.String key)Returns property's value as boolean.booleangetBoolean(java.lang.String key, boolean defaultValue)Returns property's value as boolean.java.lang.IntegergetCacheTimeoutInSeconds()Deprecated, for removal: This API element is subject to removal in a future version.since 6.5 - this method will be removed after removal ofsetProperties(Map).doublegetDouble(java.lang.String key)Returns property's value as double.intgetInteger(java.lang.String key)Returns property's value as integer.protected java.lang.StringgetLocalPropertyFile()protected java.lang.StringgetProjectPropertyFile()java.util.Map<java.lang.String,java.lang.String>getProperties()Returns all stored properties.java.lang.StringgetProperty(java.lang.String key)Returns property's value.voidinitProperties()protected voidinitProperties(java.lang.String filename)voidsetCacheTimeoutInSeconds(java.lang.Integer cacheTimeoutInSeconds)Deprecated, for removal: This API element is subject to removal in a future version.since 6.5 - this method will be removed after removal ofsetProperties(Map).voidsetLocalPropertyFile(java.lang.String localPropertyFile)voidsetProjectPropertyFile(java.lang.String projectPropertyFile)voidsetProperties(java.util.Map<java.lang.String,java.lang.String> properties)Deprecated, for removal: This API element is subject to removal in a future version.since 6.5 - properties are loaded from project and local files and should not be set manually
-
-
-
Method Detail
-
getProperty
public java.lang.String getProperty(java.lang.String key)
Description copied from interface:CockpitPropertiesReturns property's value.- Specified by:
getPropertyin interfaceCockpitProperties- Parameters:
key- key of the property to return.- Returns:
- String value of the property stored under the key.
-
getBoolean
public boolean getBoolean(java.lang.String key)
Description copied from interface:CockpitPropertiesReturns property's value as boolean. If the type of the value is known it is recommended to use this dedicated method rather than parsing the value inline while caching may be enabled (implementation dependent).- Specified by:
getBooleanin interfaceCockpitProperties- Parameters:
key- key of the property to return.- Returns:
- boolean value stored under the given key, default to null if the value is not provided or cannot be interpreted.
-
getBoolean
public boolean getBoolean(java.lang.String key, boolean defaultValue)Description copied from interface:CockpitPropertiesReturns property's value as boolean. If the type of the value is known it is recommended to use this dedicated method rather than parsing the value inline while caching may be enabled (implementation dependent).- Specified by:
getBooleanin interfaceCockpitProperties- Parameters:
key- key of the property to return.defaultValue- value to be returned if properties contains value for provided key- Returns:
- boolean value stored under the given key or {code}defaultValue{code} if the value is not provided or cannot be interpreted.
-
getInteger
public int getInteger(java.lang.String key)
Description copied from interface:CockpitPropertiesReturns property's value as integer. If the type of the value is known it is recommended to use this dedicated method rather than parsing the value inline while caching may be enabled (implementation dependent).- Specified by:
getIntegerin interfaceCockpitProperties- Parameters:
key- key of the property to return.- Returns:
- boolean value stored under the given key, default to null if the value is not provided or cannot be interpreted.
-
getDouble
public double getDouble(java.lang.String key)
Description copied from interface:CockpitPropertiesReturns property's value as double. If the type of the value is known it is recommended to use this dedicated method rather than parsing the value inline while caching may be enabled (implementation dependent).- Specified by:
getDoublein interfaceCockpitProperties- Parameters:
key- key of the property to return.- Returns:
- boolean value stored under the given key, default to null if the value is not provided or cannot be interpreted.
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()
Description copied from interface:CockpitPropertiesReturns all stored properties. This method can be resource-consuming and should be use only when user needs access to all properties.- Specified by:
getPropertiesin interfaceCockpitProperties- Returns:
- the map with all properties.
-
setProperties
@Deprecated(since="6.5", forRemoval=true) public void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)Deprecated, for removal: This API element is subject to removal in a future version.since 6.5 - properties are loaded from project and local files and should not be set manually
-
initProperties
public void initProperties()
-
initProperties
protected void initProperties(java.lang.String filename)
-
getLocalPropertyFile
protected java.lang.String getLocalPropertyFile()
-
setLocalPropertyFile
public void setLocalPropertyFile(java.lang.String localPropertyFile)
-
getProjectPropertyFile
protected java.lang.String getProjectPropertyFile()
-
setProjectPropertyFile
public void setProjectPropertyFile(java.lang.String projectPropertyFile)
-
getCacheTimeoutInSeconds
@Deprecated(since="6.5", forRemoval=true) public java.lang.Integer getCacheTimeoutInSeconds()Deprecated, for removal: This API element is subject to removal in a future version.since 6.5 - this method will be removed after removal ofsetProperties(Map).
-
setCacheTimeoutInSeconds
@Deprecated(since="6.5", forRemoval=true) public void setCacheTimeoutInSeconds(java.lang.Integer cacheTimeoutInSeconds)Deprecated, for removal: This API element is subject to removal in a future version.since 6.5 - this method will be removed after removal ofsetProperties(Map).
-
-