javax.mail.internet
Class UniqueValue

java.lang.Object
  |
  +--javax.mail.internet.UniqueValue

class UniqueValue
extends Object

This is a utility class that generates unique values. The generated String contains only US-ASCII characters and hence is safe for use in RFC822 headers.

This is a package private class.


Constructor Summary
(package private) UniqueValue()
           
 
Method Summary
static String getUniqueValue()
          Get a unique value.
static String getUniqueValue(Session ssn)
          Get a unique value.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniqueValue

UniqueValue()
Method Detail

getUniqueValue

public static String getUniqueValue()
Get a unique value. This implementation generates it by concatenating a newly created object's hashCode(), the current time (in milliseconds), the string "JavaMail", and this user's local address generated by InternetAddress.getLocalAddress(). (The address defaults to "javamailuser@localhost" is getLocalAddress() returns null.)

getUniqueValue

public static String getUniqueValue(Session ssn)
Get a unique value. This implementation generates it by concatenating a newly created object's hashCode(), the current time (in milliseconds), the string "JavaMail", and this user's local address generated by InternetAddress.getLocalAddress(). (The address defaults to "javamailuser@localhost" is getLocalAddress() returns null.)
Parameters:
ssn - Session object used to get the local address
See Also:
InternetAddress