Class Properties

java.lang.Object
pcap.common.util.Properties

@Inclubating
public final class Properties
extends Object
Author:
Ardika Rommy Sanjaya
  • Constructor Summary

    Constructors 
    Constructor Description
    Properties()  
  • Method Summary

    Modifier and Type Method Description
    static boolean getBoolean​(String key, boolean defaultValue)
    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 defaultValue)
    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 defaultValue)
    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 String getProperty​(String key)
    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 String getProperty​(String key, String defaultValue)
    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
  • Constructor Details

  • Method Details

    • getProperty

      public static String getProperty​(String key)
      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.
      Parameters:
      key - key.
      Returns:
      returns the property value. null if there's no such property or if an access to the specified property is not allowed.
      Since:
      1.2.3
    • getProperty

      public static String getProperty​(String key, String defaultValue)
      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.
      Parameters:
      key - key.
      defaultValue - default value.
      Returns:
      the property value. defaultValue if there's no such property or if an access to the specified property is not allowed.
      Since:
      1.2.3
    • getBoolean

      public static boolean getBoolean​(String key, boolean defaultValue)
      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.
      Parameters:
      key - key.
      defaultValue - default value.
      Returns:
      the property value. defaultValue if there's no such property or if an access to the specified property is not allowed.
      Since:
      1.2.6
    • getInt

      public static int getInt​(String key, int defaultValue)
      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.
      Parameters:
      key - key.
      defaultValue - default value.
      Returns:
      the property value. defaultValue if there's no such property or if an access to the specified property is not allowed.
      Since:
      1.2.6
    • getLong

      public static long getLong​(String key, long defaultValue)
      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.
      Parameters:
      key - key.
      defaultValue - default value.
      Returns:
      the property value. defaultValue if there's no such property or if an access to the specified property is not allowed.
      Since:
      1.2.6