Added a brevifying factory method:
ExpiringReference<OMGLongName> ref = ExpiringReference.create(foo, 1000); git-svn-id: https://samskivert.googlecode.com/svn/trunk@2270 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -32,6 +32,14 @@ package com.samskivert.util;
|
|||||||
*/
|
*/
|
||||||
public class ExpiringReference<T>
|
public class ExpiringReference<T>
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Creates an expiring reference with the supplied value and expiration time.
|
||||||
|
*/
|
||||||
|
public static <T> ExpiringReference<T> create (T value, long expireMillis)
|
||||||
|
{
|
||||||
|
return new ExpiringReference<T>(value, expireMillis);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value from an expiring reference but returns null if the supplied reference
|
* Gets the value from an expiring reference but returns null if the supplied reference
|
||||||
* reference is null.
|
* reference is null.
|
||||||
|
|||||||
Reference in New Issue
Block a user