package no.ssb.vtl.script.expressions;

import no.ssb.vtl.model.VTLObject;

import javax.script.Bindings;

public class MembershipExpression extends VariableExpression {

    private String dataset;

    public MembershipExpression(Class<?> type, String dataset, String right) {
        super(type, right);
    }

    public String getDatasetIdentifier() {
        return dataset;
    }

    @Override
    public VTLObject resolve(Bindings bindings) {
        return super.resolve((Bindings) bindings.get(dataset));
    }
}

@@ -100,16 +100,82 @@
 dings;%0A%0A
+import static com.google.common.base.Preconditions.checkNotNull;%0A%0A
 public c
@@ -366,16 +366,62 @@
 right);%0A
+        this.dataset = checkNotNull(dataset);%0A
     %7D%0A%0A 

Set dataset id in membership