Added a convenience method, which I swear was not just an excuse to be able to
say reference reference. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2045 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -30,6 +30,15 @@ package com.samskivert.util;
|
||||
*/
|
||||
public class ExpiringReference<T>
|
||||
{
|
||||
/**
|
||||
* Gets the value from an expiring reference but returns null if the supplied reference
|
||||
* reference is null.
|
||||
*/
|
||||
public static <T> T get (ExpiringReference<T> value)
|
||||
{
|
||||
return (value == null) ? null : value.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an reference to the specified value that will expire in the
|
||||
* specified number of milliseconds.
|
||||
|
||||
Reference in New Issue
Block a user