|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.internal.util.PropertiesHelper
public class PropertiesHelper
Helper class containing convenience methods for reading
org.glassfish.jersey.server.ResourceConfig and Configuration properties.
| Constructor Summary | |
|---|---|
PropertiesHelper()
|
|
| Method Summary | ||
|---|---|---|
static
|
getValue(Map<String,?> properties,
String key,
Class<T> type)
Returns value of a specified property. |
|
static
|
getValue(Map<String,?> properties,
String key,
T defaultValue)
Returns value of a specified property. |
|
static
|
getValue(Map<String,?> properties,
String key,
T defaultValue,
Class<T> type)
Returns value of a specified property. |
|
static boolean |
isFeatureDisabledByProperty(Configuration config,
String globalPropertyName)
Determine whether a Jersey feature ( Feature/
AutoDiscoverable) is disabled based on given global property name and it's
client/server variants. |
|
static boolean |
isProperty(Map<String,Object> properties,
String name)
Get the value of the property with a given name converted to boolean. |
|
static boolean |
isProperty(Object value)
Get the value of the property converted to boolean. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PropertiesHelper()
| Method Detail |
|---|
public static <T> T getValue(Map<String,?> properties,
String key,
T defaultValue)
PropertyHelper.getValue(properties, key, defaultValue, (Class<T>) defaultValue.getClass())
T - Type of the property value.properties - Map of properties to get the property value from.key - Name of the property.defaultValue - Default value to be returned if the specified property is not set or cannot be read.
public static <T> T getValue(Map<String,?> properties,
String key,
T defaultValue,
Class<T> type)
T - Type of the property value.properties - Map of properties to get the property value from.key - Name of the property.defaultValue - Default value of the property.type - Type to retrieve the value as.
public static <T> T getValue(Map<String,?> properties,
String key,
Class<T> type)
T - Type of the property value.properties - Map of properties to get the property value from.key - Name of the property.type - Type to retrieve the value as.
public static boolean isProperty(Map<String,Object> properties,
String name)
boolean. Returns false if the value is
not convertible.
properties - key-value map of properties.name - property name.
boolean property value or false if the property is not convertible.public static boolean isProperty(Object value)
boolean. Returns false if the value is not convertible.
value - property value.
boolean property value or false if the property is not convertible.
public static boolean isFeatureDisabledByProperty(Configuration config,
String globalPropertyName)
Feature/
AutoDiscoverable) is disabled based on given global property name and it's
client/server variants. If runtime (client/server) variant of the global property is set then the value of this property is
returned, otherwise the return value is value of the global property.
Client/Server variant of the property is derived using this pattern:
globalPropertyName + '.' + config.getRuntimeType().name().toLowerCase()
config - configuration to check the property.globalPropertyName - global property name to be checked and to derive client/server variant of the property.
true if the feature is disabled by the property value, false otherwise.CommonProperties
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||