Interface PropertiesResolver
-
public interface PropertiesResolver
Resolver of a property value for the specified propertyname
from the request-specific property bag, or theglobal runtime configuration
.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static PropertiesResolver
create(jakarta.ws.rs.core.Configuration configuration, PropertiesDelegate delegate)
Return new instance ofPropertiesResolver
.<T> T
resolveProperty(String name, Class<T> type)
Resolve a property value for the specified propertyname
.<T> T
resolveProperty(String name, T defaultValue)
Resolve a property value for the specified propertyname
.
-
-
-
Method Detail
-
resolveProperty
<T> T resolveProperty(String name, Class<T> type)
Resolve a property value for the specified propertyname
.The method returns the value of the property registered in the request-specific property bag, if available. If no property for the given property name is found in the request-specific property bag, the method looks at the properties stored in the
global runtime configuration
this request belongs to. If there is a value defined in the runtime configuration, it is returned, otherwise the method returnsnull
if no such property is registered neither in the runtime nor in the request-specific property bag.- Type Parameters:
T
- property Java type.- Parameters:
name
- property name.type
- expected property class type.- Returns:
- resolved property value or
null
if no such property is registered.
-
resolveProperty
<T> T resolveProperty(String name, T defaultValue)
Resolve a property value for the specified propertyname
.The method returns the value of the property registered in the request-specific property bag, if available. If no property for the given property name is found in the request-specific property bag, the method looks at the properties stored in the
global runtime configuration
this request belongs to. If there is a value defined in the runtime configuration, it is returned, otherwise the method returnsdefaultValue
if no such property is registered neither in the runtime nor in the request-specific property bag.- Type Parameters:
T
- property Java type.- Parameters:
name
- property name.defaultValue
- default value to return if the property is not registered.- Returns:
- resolved property value or
defaultValue
if no such property is registered.
-
create
static PropertiesResolver create(jakarta.ws.rs.core.Configuration configuration, PropertiesDelegate delegate)
Return new instance ofPropertiesResolver
.- Parameters:
configuration
- RuntimeConfiguration
.delegate
- Request scopedproperties delegate
.- Returns:
- A new instance of
PropertiesResolver
.
-
-