public class DefaultLambdaDecor<T> extends Object implements LambdaDecor<T>
| Modifier and Type | Method and Description |
|---|---|
T |
apply(T type)
Applies this
Behaviour to the given type T. |
static <T> LambdaDecor<T> |
create()
Creates a new instance.
|
static <T> LambdaDecor<T> |
create(Behaviour<T> behaviour)
Creates a new instance.
|
static <T> LambdaDecor<T> |
create(Function<Behaviour<T>,Behaviour<T>> behaviourFunction)
Creates a new instance.
|
void |
unapply()
Performs the specific
Unappliable operation of this Behaviour. |
LambdaDecor<T> |
updateBehaviour(Function<Behaviour<T>,Behaviour<T>> behaviourFunction)
Updates the held
Behaviour. |
public static <T> LambdaDecor<T> create(Behaviour<T> behaviour)
T - type for this behaviourbehaviour - the Behaviour for this classNullPointerException - if behaviour is nullpublic static <T> LambdaDecor<T> create(Function<Behaviour<T>,Behaviour<T>> behaviourFunction)
T - type for this behaviourbehaviourFunction - the Function that provides an new DefaultBehaviour instance and returns one.NullPointerException - if the function return value is nullpublic static <T> LambdaDecor<T> create()
T - type for this behaviourpublic LambdaDecor<T> updateBehaviour(Function<Behaviour<T>,Behaviour<T>> behaviourFunction)
LambdaDecorBehaviour.updateBehaviour in interface LambdaDecor<T>behaviourFunction - Function that provides the currently hold Behaviour and returns the updated BehaviourLambdaDecor objectpublic T apply(T type)
LambdaDecorapply in interface LambdaDecor<T>type - specific type TT object after applying all Behaviourspublic void unapply()
LambdaDecorUnappliable operation of this Behaviour.
After that operation the Unappliable should be empty.unapply in interface LambdaDecor<T>