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() |
javax.ws.rs.RuntimeType |
getRuntimeType() |
Object |
getValueFromConfig(String name)
Allows ancestors to work with native configuration providers
|
boolean |
isEnabled(Class<? extends javax.ws.rs.core.Feature> featureClass) |
boolean |
isEnabled(javax.ws.rs.core.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 javax.ws.rs.RuntimeType getRuntimeType()
getRuntimeType
in interface javax.ws.rs.core.Configuration
public Map<String,Object> getProperties()
getProperties
in interface javax.ws.rs.core.Configuration
public Object getProperty(String name)
getProperty
in interface javax.ws.rs.core.Configuration
public Collection<String> getPropertyNames()
getPropertyNames
in interface javax.ws.rs.core.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(javax.ws.rs.core.Feature feature)
isEnabled
in interface javax.ws.rs.core.Configuration
public boolean isEnabled(Class<? extends javax.ws.rs.core.Feature> featureClass)
isEnabled
in interface javax.ws.rs.core.Configuration
public boolean isRegistered(Object component)
isRegistered
in interface javax.ws.rs.core.Configuration
public boolean isRegistered(Class<?> componentClass)
isRegistered
in interface javax.ws.rs.core.Configuration
public Map<Class<?>,Integer> getContracts(Class<?> componentClass)
getContracts
in interface javax.ws.rs.core.Configuration
public Set<Class<?>> getClasses()
getClasses
in interface javax.ws.rs.core.Configuration
Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.