Class PropertiesLoader

java.lang.Object
org.pcap4j.util.PropertiesLoader

public class PropertiesLoader extends Object
Since:
pcap4j 0.9.1
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • resourceName

      private final String resourceName
    • systemPropertiesOverPropertiesFile

      private final boolean systemPropertiesOverPropertiesFile
    • caching

      private final boolean caching
    • prop

      private final Properties prop
    • cache

      private final Map<String,Object> cache
  • Constructor Details

    • PropertiesLoader

      public PropertiesLoader(String resourceName, boolean systemPropertiesOverPropertiesFile, boolean caching)
      Parameters:
      resourceName - resourceName
      systemPropertiesOverPropertiesFile - systemPropertiesOverPropertiesFile
      caching - caching
  • Method Details

    • getResourceName

      public final String getResourceName()
      Returns:
      resource name
    • getProp

      public final Properties getProp()
      Returns:
      a new Properties object containing properties loaded by this object.
    • isSystemPropertiesOverPropertiesFile

      public final boolean isSystemPropertiesOverPropertiesFile()
      Returns:
      true if this object gives priority to the system properties over the properties loaded by this object; false otherwise.
    • isCaching

      public final boolean isCaching()
      Returns:
      true if this object is caching values of properties; false otherwise.
    • getString

      public String getString(String key, String defaultValue)
      Parameters:
      key - key
      defaultValue - defaultValue
      Returns:
      a value got from a specified key.
    • getInteger

      public Integer getInteger(String key, Integer defaultValue)
      Parameters:
      key - key
      defaultValue - defaultValue
      Returns:
      an Integer object converted from a value got from a specified key.
    • getBoolean

      public Boolean getBoolean(String key, Boolean defaultValue)
      Parameters:
      key - key
      defaultValue - defaultValue
      Returns:
      a Boolean object converted from a value got from a specified key.
    • getClass

      public <T> Class<? extends T> getClass(String key, Class<? extends T> defaultValue)
      Type Parameters:
      T - class
      Parameters:
      key - key
      defaultValue - defaultValue
      Returns:
      a Class object converted from a value got from a specified key.
    • getInetAddress

      public InetAddress getInetAddress(String key, InetAddress defaultValue)
      Parameters:
      key - key
      defaultValue - defaultValue
      Returns:
      an InetAddress object converted from a value got from a specified key.
    • getIntArray

      public int[] getIntArray(String key, int[] defaultValue)
      Parameters:
      key - key
      defaultValue - defaultValue
      Returns:
      an int array converted from a value got from a specified key.
    • clearCache

      public final void clearCache()