Files
jpexs-decompiler/libsrc/ffdec_lib/src/com/jpexs/helpers/Reference.java
2024-08-08 19:27:14 +02:00

46 lines
1.1 KiB
Java

/*
* Copyright (C) 2010-2024 JPEXS, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
package com.jpexs.helpers;
/**
* Reference to an object. Used for passing objects by reference.
*
* @param <T> Type of the object
* @author JPEXS
*/
public class Reference<T> {
private T val;
public Reference(T val) {
this.val = val;
}
public T getVal() {
return val;
}
public void setVal(T val) {
this.val = val;
}
@Override
public String toString() {
return val.toString();
}
}