Package org.eclipse.angus.mail.util
Class PropUtil
java.lang.Object
org.eclipse.angus.mail.util.PropUtil
Utilities to make it easier to get property values.
Properties can be strings or type-specific value objects.
- Author:
- Bill Shannon
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleangetBooleanProperty(Properties props, String name, boolean def) Get a boolean valued property.static booleangetBooleanSessionProperty(Session session, String name, boolean def) Deprecated.static booleangetBooleanSystemProperty(String name, boolean def) Get a boolean valued System property.static intgetIntProperty(Properties props, String name, int def) Get an integer valued property.static intgetIntSessionProperty(Session session, String name, int def) Deprecated.static ScheduledExecutorServicegetScheduledExecutorServiceProperty(Properties props, String name) Get a ScheduledExecutorService valued property.
-
Method Details
-
getIntProperty
Get an integer valued property.- Parameters:
props- the propertiesname- the property namedef- default value if property not found- Returns:
- the property value
-
getBooleanProperty
Get a boolean valued property.- Parameters:
props- the propertiesname- the property namedef- default value if property not found- Returns:
- the property value
-
getScheduledExecutorServiceProperty
public static ScheduledExecutorService getScheduledExecutorServiceProperty(Properties props, String name) Get a ScheduledExecutorService valued property.- Parameters:
props- the propertiesname- the property name- Returns:
- the property value, null if the property is null
- Throws:
ClassCastException- if the property value's class is notScheduledThreadPoolExecutor
-
getIntSessionProperty
Deprecated.Get an integer valued property.- Parameters:
session- the Sessionname- the property namedef- default value if property not found- Returns:
- the property value
-
getBooleanSessionProperty
@Deprecated public static boolean getBooleanSessionProperty(Session session, String name, boolean def) Deprecated.Get a boolean valued property.- Parameters:
session- the Sessionname- the property namedef- default value if property not found- Returns:
- the property value
-
getBooleanSystemProperty
Get a boolean valued System property.- Parameters:
name- the property namedef- default value if property not found- Returns:
- the property value
-