Package org.eclipse.aether.util
Class ConfigUtils
java.lang.Object
org.eclipse.aether.util.ConfigUtils
A utility class to read configuration properties from a repository system session.
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleangetBoolean(Map<?, ?> properties, boolean defaultValue, String... keys) Gets the specified configuration property.static booleangetBoolean(RepositorySystemSession session, boolean defaultValue, String... keys) Gets the specified configuration property.static floatGets the specified configuration property.static floatgetFloat(RepositorySystemSession session, float defaultValue, String... keys) Gets the specified configuration property.static intgetInteger(Map<?, ?> properties, int defaultValue, String... keys) Gets the specified configuration property.static intgetInteger(RepositorySystemSession session, int defaultValue, String... keys) Gets the specified configuration property.static List<?> Gets the specified configuration property.static List<?> getList(RepositorySystemSession session, List<?> defaultValue, String... keys) Gets the specified configuration property.static longGets the specified configuration property.static longgetLong(RepositorySystemSession session, long defaultValue, String... keys) Gets the specified configuration property.static Map<?, ?> Gets the specified configuration property.static Map<?, ?> getMap(RepositorySystemSession session, Map<?, ?> defaultValue, String... keys) Gets the specified configuration property.static ObjectGets the specified configuration property.static ObjectgetObject(RepositorySystemSession session, Object defaultValue, String... keys) Gets the specified configuration property.static StringGets the specified configuration property.static StringgetString(RepositorySystemSession session, String defaultValue, String... keys) Gets the specified configuration property.parseCommaSeparatedNames(String commaSeparatedNames) Utility method to parse configuration string that contains comma separated list of names intoList<String>, never returnsnull.parseCommaSeparatedUniqueNames(String commaSeparatedNames) Utility method to parse configuration string that contains comma separated list of names intoList<String>with unique elements (duplicates, if any, are discarded), never returnsnull.
- 
Method Details- 
getObjectGets the specified configuration property.- Parameters:
- properties- the configuration properties to read, must not be- null
- defaultValue- the default value to return in case none of the property keys are set, may be- null
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a valid value is found.
- Returns:
- the property value or nullif none
 
- 
getObjectpublic static Object getObject(RepositorySystemSession session, Object defaultValue, String... keys) Gets the specified configuration property.- Parameters:
- session- the repository system session from which to read the configuration property, must not be- null
- defaultValue- the default value to return in case none of the property keys are set, may be- null
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a valid value is found.
- Returns:
- the property value or nullif none
 
- 
getStringGets the specified configuration property.- Parameters:
- properties- the configuration properties to read, must not be- null
- defaultValue- the default value to return in case none of the property keys is set to a string, may be- null
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a string value is found.
- Returns:
- the property value or nullif none
 
- 
getStringpublic static String getString(RepositorySystemSession session, String defaultValue, String... keys) Gets the specified configuration property.- Parameters:
- session- the repository system session from which to read the configuration property, must not be- null
- defaultValue- the default value to return in case none of the property keys is set to a string, may be- null
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a string value is found.
- Returns:
- the property value or nullif none
 
- 
getIntegerGets the specified configuration property.- Parameters:
- properties- the configuration properties to read, must not be- null
- defaultValue- the default value to return in case none of the property keys is set to a number
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a- Numberor a string representation of an- Integeris found.
- Returns:
- the property value
 
- 
getIntegerGets the specified configuration property.- Parameters:
- session- the repository system session from which to read the configuration property, must not be- null
- defaultValue- the default value to return in case none of the property keys is set to a number
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a- Numberor a string representation of an- Integeris found.
- Returns:
- the property value
 
- 
getLongGets the specified configuration property.- Parameters:
- properties- the configuration properties to read, must not be- null
- defaultValue- the default value to return in case none of the property keys is set to a number
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a- Numberor a string representation of a- Longis found.
- Returns:
- the property value
 
- 
getLongGets the specified configuration property.- Parameters:
- session- the repository system session from which to read the configuration property, must not be- null
- defaultValue- the default value to return in case none of the property keys is set to a number
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a- Numberor a string representation of a- Longis found.
- Returns:
- the property value
 
- 
getFloatGets the specified configuration property.- Parameters:
- properties- the configuration properties to read, must not be- null
- defaultValue- the default value to return in case none of the property keys is set to a number
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a- Numberor a string representation of a- Floatis found.
- Returns:
- the property value
 
- 
getFloatGets the specified configuration property.- Parameters:
- session- the repository system session from which to read the configuration property, must not be- null
- defaultValue- the default value to return in case none of the property keys is set to a number
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a- Numberor a string representation of a- Floatis found.
- Returns:
- the property value
 
- 
getBooleanGets the specified configuration property.- Parameters:
- properties- the configuration properties to read, must not be- null
- defaultValue- the default value to return in case none of the property keys is set to a boolean
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a- Booleanor a string (to be- parsed as boolean) is found.
- Returns:
- the property value
 
- 
getBooleanpublic static boolean getBoolean(RepositorySystemSession session, boolean defaultValue, String... keys) Gets the specified configuration property.- Parameters:
- session- the repository system session from which to read the configuration property, must not be- null
- defaultValue- the default value to return in case none of the property keys is set to a boolean
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a- Booleanor a string (to be- parsed as boolean) is found.
- Returns:
- the property value
 
- 
getListGets the specified configuration property.- Parameters:
- properties- the configuration properties to read, must not be- null
- defaultValue- the default value to return in case none of the property keys is set to a collection
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a collection is found.
- Returns:
- the property value or nullif none
 
- 
getListpublic static List<?> getList(RepositorySystemSession session, List<?> defaultValue, String... keys) Gets the specified configuration property.- Parameters:
- session- the repository system session from which to read the configuration property, must not be- null
- defaultValue- the default value to return in case none of the property keys is set to a collection
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a collection is found.
- Returns:
- the property value or nullif none
 
- 
getMapGets the specified configuration property.- Parameters:
- properties- the configuration properties to read, must not be- null
- defaultValue- the default value to return in case none of the property keys is set to a map
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a map is found.
- Returns:
- the property value or nullif none
 
- 
getMappublic static Map<?,?> getMap(RepositorySystemSession session, Map<?, ?> defaultValue, String... keys) Gets the specified configuration property.- Parameters:
- session- the repository system session from which to read the configuration property, must not be- null
- defaultValue- the default value to return in case none of the property keys is set to a map
- keys- the property keys to read, must not be- null. The specified keys are read one after one until a map is found.
- Returns:
- the property value or nullif none
 
- 
parseCommaSeparatedNamesUtility method to parse configuration string that contains comma separated list of names intoList<String>, never returnsnull.- Since:
- 1.9.0
 
- 
parseCommaSeparatedUniqueNamesUtility method to parse configuration string that contains comma separated list of names intoList<String>with unique elements (duplicates, if any, are discarded), never returnsnull.- Since:
- 1.9.0
 
 
-