Package com.sun.mail.util
Class PropUtil
- java.lang.Object
-
- com.sun.mail.util.PropUtil
-
public class PropUtil extends java.lang.Object
Utilities to make it easier to get property values. Properties can be strings or type-specific value objects.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
PropUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private static boolean
getBoolean(java.lang.Object value, boolean def)
Interpret the value object as a boolean, returning def if unable.static boolean
getBooleanProperty(java.util.Properties props, java.lang.String name, boolean def)
Get a boolean valued property.static boolean
getBooleanSessionProperty(Session session, java.lang.String name, boolean def)
Deprecated.static boolean
getBooleanSystemProperty(java.lang.String name, boolean def)
Get a boolean valued System property.private static int
getInt(java.lang.Object value, int def)
Interpret the value object as an integer, returning def if unable.static int
getIntProperty(java.util.Properties props, java.lang.String name, int def)
Get an integer valued property.static int
getIntSessionProperty(Session session, java.lang.String name, int def)
Deprecated.private static java.lang.Object
getProp(java.util.Properties props, java.lang.String name)
Get the value of the specified property.
-
-
-
Method Detail
-
getIntProperty
public static int getIntProperty(java.util.Properties props, java.lang.String name, int def)
Get an integer valued property.- Parameters:
props
- the propertiesname
- the property namedef
- default value if property not found- Returns:
- the property value
-
getBooleanProperty
public static boolean getBooleanProperty(java.util.Properties props, java.lang.String name, boolean def)
Get a boolean valued property.- Parameters:
props
- the propertiesname
- the property namedef
- default value if property not found- Returns:
- the property value
-
getIntSessionProperty
@Deprecated public static int getIntSessionProperty(Session session, java.lang.String name, int def)
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, java.lang.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
public static boolean getBooleanSystemProperty(java.lang.String name, boolean def)
Get a boolean valued System property.- Parameters:
name
- the property namedef
- default value if property not found- Returns:
- the property value
-
getProp
private static java.lang.Object getProp(java.util.Properties props, java.lang.String name)
Get the value of the specified property. If the "get" method returns null, use the getProperty method, which might cascade to a default Properties object.
-
getInt
private static int getInt(java.lang.Object value, int def)
Interpret the value object as an integer, returning def if unable.
-
getBoolean
private static boolean getBoolean(java.lang.Object value, boolean def)
Interpret the value object as a boolean, returning def if unable.
-
-