diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-13 16:54:12 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2016-04-13 16:54:12 -0400 |
| commit | ba07771f8333f1b098ab8a9ec9fec886b72b9cc0 (patch) | |
| tree | 7d1326235d021cb4767065cddd25bbe9fbdf5ce1 /BJC-Utils2/src/main/java/bjc/utils/data/IHolder.java | |
| parent | 12637af8d6b7b9b2d96deb89e5a09e05178a8e65 (diff) | |
Removed old data types
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/data/IHolder.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/data/IHolder.java | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/IHolder.java b/BJC-Utils2/src/main/java/bjc/utils/data/IHolder.java deleted file mode 100644 index a4f4013..0000000 --- a/BJC-Utils2/src/main/java/bjc/utils/data/IHolder.java +++ /dev/null @@ -1,70 +0,0 @@ -package bjc.utils.data; - -import java.util.function.Consumer; -import java.util.function.Function; - -/** - * Generic interface for things that store a single value in a roughly - * monadic fashion - * - * @author ben - * - * @param <T> - * The type of data being stored - */ -public interface IHolder<T> { - - /** - * Call a provided function with the value being held - * - * @param action - * The function to call - */ - public void doWith(Consumer<T> action); - - /** - * Return the result of applying the given transformation to the held - * value. Doesn't change the held value. - * - * @param <NewT> - * The new type of the held value - * - * @param transformer - * The transformation to apply - * @return A holder with the transformed value - */ - public <NewT> IHolder<NewT> map(Function<T, NewT> transformer); - - /** - * Apply the given transformation to the held value. Returns the holder - * for allowing chaining of transforms - * - * @param transformer - * The transform to apply to the value - * @return The holder - */ - public IHolder<T> transform(Function<T, T> transformer); - - /** - * Returns a raw mapped value, not contained in a GenHolder - * - * @param <E> - * The type of the value that is the end result - * - * @param unwrapper - * The function to use for mapping the value - * @return The mapped value outside of a GenHolder - */ - public <E> E unwrap(Function<T, E> unwrapper); - - /** - * Bind the value in this holder to a new value - * - * @param <E> - * The new type of the held value - * @param binder - * The function to do the binding with - * @return The bound value - */ - public <E> IHolder<E> bind(Function<T, IHolder<E>> binder); -}
\ No newline at end of file |
