package fr.ourten.teabeans.binding;

import fr.ourten.teabeans.value.Observable;

import java.util.function.Supplier;

/**
 * @author Ourten 15 oct. 2016
 */
public class Expression<T> extends Binding<T>
{
    private final Supplier<? extends T> closure;

    public Expression(Supplier<? extends T> closure, Observable... dependencies)
    {
        this.closure = closure;
        super.bind(dependencies);
    }

    @Override
    public T computeValue()
    {
        return closure.get();
    }

    public static <V> Expression<V> getExpression(Supplier<? extends V> closure,
                                                  Observable... dependencies)
    {
        return new Expression<>(closure, dependencies);
    }
}
@@ -75,16 +75,42 @@
 vable;%0A%0A
+import java.util.Objects;%0A
 import j
@@ -137,16 +137,16 @@
 pplier;%0A
-
 %0A/**%0A * 
@@ -241,14 +241,8 @@
 ate 
-final 
 Supp
@@ -469,32 +469,32 @@
 teValue()%0A    %7B%0A
-
         return c
@@ -510,24 +510,199 @@
 t();%0A    %7D%0A%0A
+    public void setClosure(Supplier%3C? extends T%3E closure)%0A    %7B%0A        Objects.requireNonNull(closure);%0A        %0A        this.closure = closure;%0A        invalidate();%0A    %7D%0A%0A
     public s

Make Expression closure mutable