package com.c2kernel.gui.tabs.execution; import java.util.ArrayList; import com.c2kernel.entity.agent.Job; import com.c2kernel.lifecycle.instance.stateMachine.States; public class ActivityItem { public String stepPath; public int state; public String name; ArrayList jobs = new ArrayList<>(); public ActivityItem() { stepPath = ""; state = -1; name = "--"; } public ActivityItem(Job thisJob) { stepPath = thisJob.getStepPath(); state = thisJob.getCurrentState(); name = thisJob.getStepName(); jobs.add(thisJob); } public void addJob(Job newJob) { jobs.add(newJob); } public ArrayList getJobs() { return jobs; } public String getStepPath() { return stepPath; } public String toString() { return name+(state>-1?" ("+States.getStateName(state)+")":""); } public boolean equals(Object other) { if (other instanceof ActivityItem) return hashCode() == ((ActivityItem)other).hashCode(); return false; } public int hashCode() { return stepPath.hashCode(); } }