Class TypeSwitch1<I,O>
- java.lang.Object
-
- com.g2forge.alexandria.java.type.function.TypeSwitch1<I,O>
-
- All Implemented Interfaces:
IConsumer
,IConsumer1<I>
,IFunction<O>
,IFunction1<I,O>
,IFunctional
,IThrowConsumer1<I,RuntimeException>
,IThrowFunction1<I,O,RuntimeException>
,Consumer<I>
,Function<I,O>
public class TypeSwitch1<I,O> extends Object implements IFunction1<I,O>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TypeSwitch1.ConsumerBuilder<I>
static class
TypeSwitch1.FunctionBuilder<I,O>
protected static class
TypeSwitch1.Node<O>
-
Nested classes/interfaces inherited from interface com.g2forge.alexandria.java.function.IFunction1
IFunction1.Identity<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected IFunction1<? super I,? extends O>
fallback
protected TypeSwitch1.Node<O>
root
-
Constructor Summary
Constructors Constructor Description TypeSwitch1(IFunction1<? super I,? extends O> fallback, com.g2forge.alexandria.java.type.function.TypedFunction1<I,O>... functions)
TypeSwitch1(IFunction1<? super I,? extends O> fallback, Collection<? extends ITypedFunction1<?,? extends O>> functions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description O
apply(I input)
protected IFunction1<? super I,? extends O>
getFallback()
protected TypeSwitch1.Node<O>
getRoot()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.g2forge.alexandria.java.function.IConsumer1
andThen
-
Methods inherited from interface com.g2forge.alexandria.java.function.IFunction1
accept, andThen, applyWithFallback, compose, curry, lift, lift, noReturn, override, sync, toConsumer, toFunction, wrap
-
Methods inherited from interface com.g2forge.alexandria.java.function.IThrowFunction1
wrap
-
-
-
-
Field Detail
-
fallback
protected final IFunction1<? super I,? extends O> fallback
-
root
protected final TypeSwitch1.Node<O> root
-
-
Constructor Detail
-
TypeSwitch1
public TypeSwitch1(IFunction1<? super I,? extends O> fallback, Collection<? extends ITypedFunction1<?,? extends O>> functions)
-
TypeSwitch1
@SafeVarargs public TypeSwitch1(IFunction1<? super I,? extends O> fallback, com.g2forge.alexandria.java.type.function.TypedFunction1<I,O>... functions)
-
-
Method Detail
-
apply
public O apply(I input)
- Specified by:
apply
in interfaceFunction<I,O>
- Specified by:
apply
in interfaceIThrowFunction1<I,O,RuntimeException>
-
getFallback
protected IFunction1<? super I,? extends O> getFallback()
-
getRoot
protected TypeSwitch1.Node<O> getRoot()
-
-