Class Config

java.lang.Object
io.appium.java_client.internal.Config

public class Config extends Object
  • Method Details

    • main

      public static Config main()
      Retrieve a facade for the main config.
      Returns:
      interaction helper for 'main.properties' config
    • getValue

      public <T> T getValue(String key, 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 retrieve
      valueType - the expected type of the value to be retrieved
      Returns:
      the actual value
      Throws:
      IllegalArgumentException - if the given key does not exist
      ClassCastException - if the retrieved value cannot be cast to `valueType` type
    • getOptionalValue

      public <T> Optional<T> getOptionalValue(String key, 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 retrieve
      valueType - the expected type of the value to be retrieved
      Returns:
      the actual value or Optional.empty() if the key is not present
      Throws:
      UncheckedIOException - if the given properties file does not exist/not accessible
      ClassCastException - if the retrieved value cannot be cast to `valueType` type