Package io.appium.java_client.internal
Class Config
- java.lang.Object
-
- io.appium.java_client.internal.Config
-
public class Config extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> java.util.Optional<T>getOptionalValue(java.lang.String key, java.lang.Class<T> valueType)Retrieve a value from properties file.<T> TgetValue(java.lang.String key, java.lang.Class<T> valueType)Retrieve a value from properties file.static Configmain()Retrieve a facade for the main config.
-
-
-
Method Detail
-
main
public static Config main()
Retrieve a facade for the main config.- Returns:
- interaction helper for 'main.properties' config
-
getValue
public <T> T getValue(java.lang.String key, java.lang.Class<T> valueType)Retrieve a value from properties file.- Type Parameters:
T- the value type.- Parameters:
key- the name of the corresponding key which value to retrievevalueType- the expected type of the value to be retrieved- Returns:
- the actual value
- Throws:
java.lang.IllegalArgumentException- if the given key does not existjava.lang.ClassCastException- if the retrieved value cannot be cast to `valueType` type
-
getOptionalValue
public <T> java.util.Optional<T> getOptionalValue(java.lang.String key, java.lang.Class<T> valueType)Retrieve a value from properties file.- Type Parameters:
T- the type of the resulting value.- Parameters:
key- the name of the corresponding key which value to retrievevalueType- the expected type of the value to be retrieved- Returns:
- the actual value or
Optional.empty()if the key is not present - Throws:
java.io.UncheckedIOException- if the given properties file does not exist/not accessiblejava.lang.ClassCastException- if the retrieved value cannot be cast to `valueType` type
-
-