package edu.brown.cs.systems.pivottracing.tracepoint;

import java.util.List;

import com.google.common.collect.Lists;

import edu.brown.cs.systems.pivottracing.advice.AdviceProtos.AdviceSpec;
import edu.brown.cs.systems.pivottracing.agent.WeaveProtos.TracepointSpec;

public class HardcodedTracepoint implements Tracepoint {
    
    private final String name, id;
    private final List<String> exports;
    
    private HardcodedTracepoint(String name, String id, String... exports) {
        this.name = name;
        this.id = id;
        this.exports = Lists.newArrayList(exports);
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public boolean exports(String varName) {
        return exports.contains(varName);
    }

    @Override
    public List<TracepointSpec> getTracepointSpecsForAdvice(AdviceSpec advice) {
        TracepointSpec.Builder spec = TracepointSpec.newBuilder();
        spec.getHardcodedTracepointBuilder().setId(id).addAllExport(exports);
        return Lists.newArrayList(spec.build());
    }

}

@@ -578,32 +578,174 @@
 (exports);%0A    %7D
+%0A    %0A    public static HardcodedTracepoint get(String id, String... exports) %7B%0A        return new HardcodedTracepoint(id, id, exports);%0A    %7D
 %0A%0A    @Override%0A

Add static accessor method