package com.ruoyi.common.lib;

public final class Ref<T>
{
    private T ref;

    public Ref() {}

    public Ref(T t)
    {
        ref = t;
    }

    public T Unref()
    {
        T t = ref;
        ref = null;
        return t;
    }

    public T Ref(T t)
    {
        T r = ref;
        ref = t;
        return r;
    }

    public T Get()
    {
        return ref;
    }
}
