Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package org.litesoft.core.simpletypes;

import org.litesoft.commonfoundation.base.*;

public class GenericReference<V> implements Disposable
{
    private V mValue;

    public GenericReference( V pValue )
    {
        mValue = pValue;
    }

    public V get()
    {
        return mValue;
    }

    @Override
    public void dispose()
    {
        if ( mValue instanceof Disposable )
        {
            ((Disposable) mValue).dispose();
        }
        mValue = null;
    }

    public static <T> GenericReference<T> dispose( GenericReference<T> pInstance )
    {
        if ( pInstance != null )
        {
            pInstance.dispose();
        }
        return null;
    }
}

Commits for litesoft/trunk/Java/core/Anywhere/src/org/litesoft/core/simpletypes/GenericReference.java

Diff revisions: vs.
Revision Author Commited Message
939 Diff Diff GeorgeS picture GeorgeS Mon 02 Jun, 2014 21:30:31 +0000

Extracting commonfoundation

194 GeorgeS picture GeorgeS Thu 05 May, 2011 16:06:08 +0000