package com.cadrlife.devsearch.agent.action; import java.util.LinkedHashMap; import java.util.Map; public class AgentActions { // List<AgentAction> actionList = new ArrayList<>(); Map<String, AgentAction> acceptedNames = new LinkedHashMap<>(); public AgentActions add(AgentAction agentAction) { // actionList.add(agentAction); acceptedNames.put(agentAction.getName(), agentAction); return this; } public boolean isKnownAction(String actionName) { return acceptedNames.containsKey(actionName); } public Iterable<String> getActionNames() { return acceptedNames.keySet(); } public AgentAction findAction(String name) { return acceptedNames.get(name); } }