Top Description Constructors Methods
com.sun.mail.util

public Class PropUtil

extends Object
Class Inheritance
Imports
java.util.*, javax.mail.Session

Utilities to make it easier to get property values. Properties can be strings or type-specific value objects.
Author
Bill Shannon

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static boolean
getBoolean(Object value, boolean def)

Interpret the value object as a boolean, returning def if unable.

public static boolean

Returns:

the property value
getBooleanProperty
(Properties
the properties
props
,
String
the property name
name
,
boolean
default value if property not found
def
)

Get a boolean valued property.

public static boolean

Returns:

the property value
getBooleanSessionProperty
(Session
the Session
session
,
String
the property name
name
,
boolean
default value if property not found
def
)

Deprecated
Get a boolean valued property.
public static boolean

Returns:

the property value
getBooleanSystemProperty
(String
the property name
name
,
boolean
default value if property not found
def
)

Get a boolean valued System property.

private static int
getInt(Object value, int def)

Interpret the value object as an integer, returning def if unable.

public static int

Returns:

the property value
getIntProperty
(Properties
the properties
props
,
String
the property name
name
,
int
default value if property not found
def
)

Get an integer valued property.

public static int

Returns:

the property value
getIntSessionProperty
(Session
the Session
session
,
String
the property name
name
,
int
default value if property not found
def
)

Deprecated
Get an integer valued property.
private static Object
getProp(Properties props, String name)

Get the value of the specified property.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PropUtilback to summary
private PropUtil()

Method Detail

getBooleanback to summary
private static boolean getBoolean(Object value, boolean def)

Interpret the value object as a boolean, returning def if unable.

getBooleanPropertyback to summary
public static boolean getBooleanProperty(Properties props, String name, boolean def)

Get a boolean valued property.

Parameters
props:Properties

the properties

name:String

the property name

def:boolean

default value if property not found

Returns:boolean

the property value

getBooleanSessionPropertyback to summary
public static boolean getBooleanSessionProperty(Session session, String name, boolean def)

Deprecated

Get a boolean valued property.

Parameters
session:Session

the Session

name:String

the property name

def:boolean

default value if property not found

Returns:boolean

the property value

Annotations
@Deprecated
getBooleanSystemPropertyback to summary
public static boolean getBooleanSystemProperty(String name, boolean def)

Get a boolean valued System property.

Parameters
name:String

the property name

def:boolean

default value if property not found

Returns:boolean

the property value

getIntback to summary
private static int getInt(Object value, int def)

Interpret the value object as an integer, returning def if unable.

getIntPropertyback to summary
public static int getIntProperty(Properties props, String name, int def)

Get an integer valued property.

Parameters
props:Properties

the properties

name:String

the property name

def:int

default value if property not found

Returns:int

the property value

getIntSessionPropertyback to summary
public static int getIntSessionProperty(Session session, String name, int def)

Deprecated

Get an integer valued property.

Parameters
session:Session

the Session

name:String

the property name

def:int

default value if property not found

Returns:int

the property value

Annotations
@Deprecated
getPropback to summary
private static Object getProp(Properties props, 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.