public class SystemPropertiesConfigurationModel extends Object implements ExternalConfigurationModel<Void>
System
properties. The properties are listed in a property class
in a form of public static final String
property name. The String
value of the property name is searched
among the System
properties. The property scan is performed only when
CommonProperties.ALLOW_SYSTEM_PROPERTIES_PROVIDER
is set to true
.Constructor and Description |
---|
SystemPropertiesConfigurationModel(List<String> propertyClassNames)
Create new
ExternalConfigurationModel for properties defined by classes in propertyClassNames list. |
Modifier and Type | Method and Description |
---|---|
<T> T |
as(String name,
Class<T> clazz)
Get value of a property as a definite type
property shall exist in order for this method to be used.
|
Set<Class<?>> |
getClasses() |
Void |
getConfig()
Obtain config object
|
Map<Class<?>,Integer> |
getContracts(Class<?> componentClass) |
Set<Object> |
getInstances() |
<T> Optional<T> |
getOptionalProperty(String name,
Class<T> clazz)
Get value of a property as a definite type
property may not exist, an empty Optional object is returned in case of an empty property
|
Map<String,Object> |
getProperties() |
Object |
getProperty(String name) |
protected List<String> |
getPropertyClassNames() |
Collection<String> |
getPropertyNames() |
RuntimeType |
getRuntimeType() |
boolean |
isEnabled(Class<? extends Feature> featureClass) |
boolean |
isEnabled(Feature feature) |
boolean |
isProperty(String name)
Get the value of the property with a given name converted to
boolean . |
boolean |
isRegistered(Class<?> componentClass) |
boolean |
isRegistered(Object component) |
ExternalConfigurationModel |
mergeProperties(Map<String,Object> inputProperties)
Merge properties from other (found) external configuration.
|
public SystemPropertiesConfigurationModel(List<String> propertyClassNames)
ExternalConfigurationModel
for properties defined by classes in propertyClassNames
list.propertyClassNames
- List of property defining class names.public <T> T as(String name, Class<T> clazz)
ExternalConfigurationModel
as
in interface ExternalConfigurationModel<Void>
T
- type of an expected valuename
- property nameclazz
- class type of an expected valuepublic <T> Optional<T> getOptionalProperty(String name, Class<T> clazz)
ExternalConfigurationModel
getOptionalProperty
in interface ExternalConfigurationModel<Void>
T
- type of an expected valuename
- property nameclazz
- class type of an expected valuepublic ExternalConfigurationModel mergeProperties(Map<String,Object> inputProperties)
ExternalConfigurationModel
mergeProperties
in interface ExternalConfigurationModel<Void>
inputProperties
- those properties will be merged into ourspublic Void getConfig()
ExternalConfigurationModel
getConfig
in interface ExternalConfigurationModel<Void>
public boolean isProperty(String name)
ExtendedConfig
boolean
.
Returns false
if the value is not convertible.isProperty
in interface ExtendedConfig
name
- property name.boolean
property value or false
if the property is not
convertible.public RuntimeType getRuntimeType()
getRuntimeType
in interface Configuration
public Map<String,Object> getProperties()
getProperties
in interface Configuration
public Object getProperty(String name)
getProperty
in interface Configuration
public Collection<String> getPropertyNames()
getPropertyNames
in interface Configuration
public boolean isEnabled(Feature feature)
isEnabled
in interface Configuration
public boolean isEnabled(Class<? extends Feature> featureClass)
isEnabled
in interface Configuration
public boolean isRegistered(Object component)
isRegistered
in interface Configuration
public boolean isRegistered(Class<?> componentClass)
isRegistered
in interface Configuration
public Map<Class<?>,Integer> getContracts(Class<?> componentClass)
getContracts
in interface Configuration
public Set<Class<?>> getClasses()
getClasses
in interface Configuration
public Set<Object> getInstances()
getInstances
in interface Configuration
Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.