Class PropertiesLoader
java.lang.Object
org.pcap4j.util.PropertiesLoader
- Since:
- pcap4j 0.9.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate static final org.slf4j.Loggerprivate final Propertiesprivate final Stringprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionPropertiesLoader(String resourceName, boolean systemPropertiesOverPropertiesFile, boolean caching) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidgetBoolean(String key, Boolean defaultValue) <T> Class<? extends T> getInetAddress(String key, InetAddress defaultValue) int[]getIntArray(String key, int[] defaultValue) getInteger(String key, Integer defaultValue) final PropertiesgetProp()final Stringfinal booleanfinal boolean
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
resourceName
-
systemPropertiesOverPropertiesFile
private final boolean systemPropertiesOverPropertiesFile -
caching
private final boolean caching -
prop
-
cache
-
-
Constructor Details
-
PropertiesLoader
public PropertiesLoader(String resourceName, boolean systemPropertiesOverPropertiesFile, boolean caching) - Parameters:
resourceName- resourceNamesystemPropertiesOverPropertiesFile- systemPropertiesOverPropertiesFilecaching- caching
-
-
Method Details
-
getResourceName
- Returns:
- resource name
-
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
-
getInteger
-
getBoolean
-
getClass
-
getInetAddress
- Parameters:
key- keydefaultValue- defaultValue- Returns:
- an InetAddress object converted from a value got from a specified key.
-
getIntArray
- Parameters:
key- keydefaultValue- defaultValue- Returns:
- an int array converted from a value got from a specified key.
-
clearCache
public final void clearCache()
-