001// SPDX-License-Identifier: GPL-3.0-or-later
002
003package es.uvigo.esei.sing.textproc.step.util;
004
005import lombok.AllArgsConstructor;
006import lombok.Getter;
007import lombok.Setter;
008
009/**
010 * Utility class whose only purpose is to provide a final reference to an
011 * object, even if the wrapped object itself changes. The reference can be
012 * {@code null}.
013 *
014 * @author Alejandro González García
015 *
016 * @param <T> The type of the variable to hold.
017 * @implNote The implementation of this class is not thread safe.
018 */
019@AllArgsConstructor
020public final class VariableHolder<T> {
021        @Getter @Setter
022        private T variable;
023}