T - type for this behaviourpublic interface Behaviour<T>
Behaviour.
A Behaviour is internal defined as a Function that accepts and returns a specific type T.
Furthermore a Behaviour can handle a Function that accepts a specific type T and returns a Unappliable.
A Behaviour implementation should be immutable.| Modifier and Type | Method and Description |
|---|---|
DecorPair<T> |
apply(T type)
Applies this
Behaviour to the given type T. |
Behaviour<T> |
merge(Behaviour<T> behaviour)
|
static <T> Behaviour<T> |
mergeAll(Behaviour<T> behaviour,
Behaviour<T>... behaviours)
|
default Behaviour<T> |
mergeAll(Stream<Behaviour<T>> behaviourStream)
|
Behaviour<T> |
with(Function<T,T> function)
Adds a
Function that accepts and returns a specific type T. |
static <T> Behaviour<T> |
withAll(Behaviour<T> behaviour,
Function<T,T>... functions)
|
default Behaviour<T> |
withAll(Stream<Function<T,T>> functionStream)
|
Behaviour<T> |
withUnapply(Function<T,Unappliable> function)
|
static <T> Behaviour<T> |
withUnapplyAll(Behaviour<T> behaviour,
Function<T,Unappliable>... functions)
|
default Behaviour<T> |
withUnapplyAll(Stream<Function<T,Unappliable>> functionStream)
|
@SafeVarargs static <T> Behaviour<T> withAll(Behaviour<T> behaviour, Function<T,T>... functions)
T - type for this behaviourbehaviour - Behaviour whose withAll(Stream) method is calledfunctions - Function varargBehaviour with added FunctionsNullPointerException - If behaviour is null or
if functions is null@SafeVarargs static <T> Behaviour<T> withUnapplyAll(Behaviour<T> behaviour, Function<T,Unappliable>... functions)
T - type for this behaviourbehaviour - Behaviour whose withUnapplyAll(Stream) method is calledfunctions - Function varargBehaviour with added FunctionsNullPointerException - if behaviour is null or
if functions is null@SafeVarargs static <T> Behaviour<T> mergeAll(Behaviour<T> behaviour, Behaviour<T>... behaviours)
T - type for this behaviourbehaviour - Behaviour whose mergeAll(Stream) method is calledbehaviours - Behaviour varargBehaviourNullPointerException - if behaviour is null or
if behaviours is nullBehaviour<T> with(Function<T,T> function)
Function that accepts and returns a specific type T.
T is passed to the next Function.function - Function that accepts and returns a specific type TBehaviour with added FunctionNullPointerException - if function is nullBehaviour<T> withUnapply(Function<T,Unappliable> function)
Function that accepts a specific type T and returns an Unappliable.
T is passed from the last Function with a return type T.function - Function that accepts the specific type T and returns an UnappliableBehaviour with added FunctionNullPointerException - if function is nulldefault Behaviour<T> withUnapplyAll(Stream<Function<T,Unappliable>> functionStream)
functionStream - Stream containing FunctionsBehaviour with added FunctionsNullPointerException - if functionStream is nullBehaviour<T> merge(Behaviour<T> behaviour)
behaviour - Behaviour that is merged into this BehaviourBehaviourNullPointerException - if behaviour is nulldefault Behaviour<T> mergeAll(Stream<Behaviour<T>> behaviourStream)
behaviourStream - Stream containing BehavioursBehaviourNullPointerException - if behaviourStream is null