CONFIG
- type of MP configuration implpublic class ConfigurationModel<CONFIG extends org.eclipse.microprofile.config.Config> extends Object implements ExternalConfigurationModel<CONFIG>
Constructor and Description |
---|
ConfigurationModel(CONFIG config) |
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() |
CONFIG |
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) |
Collection<String> |
getPropertyNames() |
RuntimeType |
getRuntimeType() |
Object |
getValueFromConfig(String name)
Allows ancestors to work with native configuration providers
|
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 ConfigurationModel(CONFIG config)
public <T> T as(String name, Class<T> clazz)
ExternalConfigurationModel
as
in interface ExternalConfigurationModel<CONFIG extends org.eclipse.microprofile.config.Config>
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<CONFIG extends org.eclipse.microprofile.config.Config>
T
- type of an expected valuename
- property nameclazz
- class type of an expected valuepublic CONFIG getConfig()
ExternalConfigurationModel
getConfig
in interface ExternalConfigurationModel<CONFIG extends org.eclipse.microprofile.config.Config>
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 Object getValueFromConfig(String name)
name
- property namepublic 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 ExternalConfigurationModel mergeProperties(Map<String,Object> inputProperties)
ExternalConfigurationModel
mergeProperties
in interface ExternalConfigurationModel<CONFIG extends org.eclipse.microprofile.config.Config>
inputProperties
- those properties will be merged into ourspublic 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-2023, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.