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.
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UniqueValue
UniqueValue()
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