package org.infinispan.commons.util;

/**
 * This class can be used to pass an argument by reference.
 * @param <T> The wrapped type.
 *
 * @author Dan Berindei
 * @since 5.1
 */
public class ByRef<T> {
   private T ref;

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

   public static <T> ByRef<T> create(T t) {
      return new ByRef<T>(t);
   }

   public T get() {
      return ref;
   }

   public void set(T t) {
      ref = t;
   }
}
