org.snapscript.agent.debug.ScopeVariableTree Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snap-all Show documentation
Show all versions of snap-all Show documentation
Dynamic scripting for the JVM
package org.snapscript.agent.debug;
import java.util.Collections;
import java.util.Map;
public class ScopeVariableTree {
public static final ScopeVariableTree EMPTY = new ScopeVariableTree.Builder(-1)
.withEvaluation(Collections.EMPTY_MAP)
.withLocal(Collections.EMPTY_MAP)
.build();
private final Map> evaluation;
private final Map> local;
private final int change;
private ScopeVariableTree(Builder builder) {
this.evaluation = Collections.unmodifiableMap(builder.evaluation);
this.local = Collections.unmodifiableMap(builder.local);
this.change = builder.change;
}
public Map> getLocal() {
return local;
}
public Map> getEvaluation() {
return evaluation;
}
public int getChange() {
return change;
}
public static class Builder {
private Map> evaluation;
private Map> local;
private int change;
public Builder(int change){
this.change = change;
}
public Builder withEvaluation(Map> evaluation) {
this.evaluation = evaluation;
return this;
}
public Builder withLocal(Map> local) {
this.local = local;
return this;
}
public Builder withChange(int change) {
this.change = change;
return this;
}
public ScopeVariableTree build() {
return new ScopeVariableTree(this);
}
}
}