All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.dagere.peass.dependency.traces.coverage.TraceCallSummary Maven / Gradle / Ivy

There is a newer version: 0.4.0
Show newest version
package de.dagere.peass.dependency.traces.coverage;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import com.fasterxml.jackson.annotation.JsonIgnore;

import de.dagere.peass.dependency.analysis.data.TestCase;

/**
 * Information of a trace how often each method has been called for JSON serialization
 * 
 * @author reichelt
 *
 */
public class TraceCallSummary {

   private int overallScore;
   private boolean selected;
   private TestCase testcase;
   private Map callCounts = new HashMap<>();
   private Set selectedChanges = new HashSet<>();

   public boolean isSelected() {
      return selected;
   }

   public void setSelected(final boolean selected) {
      this.selected = selected;
   }

   public TestCase getTestcase() {
      return testcase;
   }

   public void setTestcase(final TestCase testcase) {
      this.testcase = testcase;
   }

   public Map getCallCounts() {
      return callCounts;
   }

   public void setCallCounts(final Map callCounts) {
      this.callCounts = callCounts;
   }

   public void setSelectedChanges(final Set selectedChanges) {
      this.selectedChanges = selectedChanges;
   }

   public Set getSelectedChanges() {
      return selectedChanges;
   }

   public void setOverallScore(final int overallScore) {
      this.overallScore = overallScore;
   }

   public int getOverallScore() {
      return overallScore;
   }

   @JsonIgnore
   public void addCall(final String method) {
      Integer callCount = callCounts.get(method);
      if (callCount == null) {
         callCounts.put(method, 1);
      } else {
         callCounts.put(method, callCount + 1);
      }
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy