Package net.uptheinter.interceptify.util
Class Boxed<T>
java.lang.Object
net.uptheinter.interceptify.util.Boxed<T>
- Type Parameters:
T
- The boxed type.
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 Summary
Constructors -
Method Summary
-
Constructor Details
-
Boxed
- Parameters:
obj
- the object to box.
-
-
Method Details
-
run
- 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
Intended for finalising operations when you no longer need to userun()
- Returns:
- the boxed object
-
set
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
-