Class Boxed<T>

java.lang.Object
net.uptheinter.interceptify.util.Boxed<T>
Type Parameters:
T - The boxed type.

public class Boxed<T> extends Object
This is a generic class for composing operations over a type. Internal. If you need this class, you are suggested to make a copy of it, with respect to the license.
  • Constructor Details

    • Boxed

      public Boxed(T obj)
      Parameters:
      obj - the object to box.
  • Method Details

    • run

      public Boxed<T> run(UnaryOperator<T> func)
      Parameters:
      func - A callable type (such as a lambda) that will operate on the boxed object and return it after such changes.
      Returns:
      this
    • get

      public T get()
      Intended for finalising operations when you no longer need to use run()
      Returns:
      the boxed object
    • set

      public T set(T obj)
      If, for some reason you need to overwrite the type that is currently boxed, use this.
      Parameters:
      obj - the object to put inside this box.
      Returns:
      obj