Class SystemPropertyUtil

java.lang.Object
org.apache.drill.exec.util.SystemPropertyUtil

public final class SystemPropertyUtil extends Object
A collection of utility methods to retrieve and parse the values of Java system properties. This is a modified version of Netty's internal system property utility class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Returns true if and only if the system property with the specified key exists.
    static String
    get(String key)
    Returns the value of the Java system property with the specified key, while falling back to null if the property access fails.
    static String
    get(String key, String def)
    Returns the value of the Java system property with the specified key, while falling back to the specified default value if the property access fails.
    static boolean
    getBoolean(String key, boolean def)
    Returns the value of the Java system property with the specified key, while falling back to the specified default value if the property access fails.
    static int
    getInt(String key, int def)
    Returns the value of the Java system property with the specified key, while falling back to the specified default value if the property access fails.
    static long
    getLong(String key, long def)
    Returns the value of the Java system property with the specified key, while falling back to the specified default value if the property access fails.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • contains

      public static boolean contains(String key)
      Returns true if and only if the system property with the specified key exists.
    • get

      public static String get(String key)
      Returns the value of the Java system property with the specified key, while falling back to null if the property access fails.
      Returns:
      the property value or null
    • get

      public static String get(String key, String def)
      Returns the value of the Java system property with the specified key, while falling back to the specified default value if the property access fails.
      Returns:
      the property value. def if there's no such property or if an access to the specified property is not allowed.
    • getBoolean

      public static boolean getBoolean(String key, boolean def)
      Returns the value of the Java system property with the specified key, while falling back to the specified default value if the property access fails.
      Returns:
      the property value. def if there's no such property or if an access to the specified property is not allowed.
    • getInt

      public static int getInt(String key, int def)
      Returns the value of the Java system property with the specified key, while falling back to the specified default value if the property access fails.
      Returns:
      the property value. def if there's no such property or if an access to the specified property is not allowed.
    • getLong

      public static long getLong(String key, long def)
      Returns the value of the Java system property with the specified key, while falling back to the specified default value if the property access fails.
      Returns:
      the property value. def if there's no such property or if an access to the specified property is not allowed.