From 7006f016b5339f27a7c8f8fdcb94171a7b6e13a4 Mon Sep 17 00:00:00 2001 From: mdb Date: Wed, 31 Jan 2007 23:09:12 +0000 Subject: [PATCH] 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 --- src/java/com/samskivert/util/ExpiringReference.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/java/com/samskivert/util/ExpiringReference.java b/src/java/com/samskivert/util/ExpiringReference.java index 6ffd7b3f..7ae4c6e7 100644 --- a/src/java/com/samskivert/util/ExpiringReference.java +++ b/src/java/com/samskivert/util/ExpiringReference.java @@ -30,6 +30,15 @@ package com.samskivert.util; */ public class ExpiringReference { + /** + * Gets the value from an expiring reference but returns null if the supplied reference + * reference is null. + */ + public static T get (ExpiringReference value) + { + return (value == null) ? null : value.getValue(); + } + /** * Creates an reference to the specified value that will expire in the * specified number of milliseconds.