Search in sources :

Example 1 with AgentComparator

use of io.nuls.consensus.poc.protocol.util.AgentComparator in project nuls by nuls-io.

the class CacheLoader method loadAgents.

public List<Agent> loadAgents() {
    List<Agent> agentList = new ArrayList<>();
    List<AgentPo> poList = this.agentStorageService.getList();
    for (AgentPo po : poList) {
        Agent agent = PoConvertUtil.poToAgent(po);
        agentList.add(agent);
    }
    Collections.sort(agentList, new AgentComparator());
    return agentList;
}
Also used : Agent(io.nuls.consensus.poc.protocol.entity.Agent) ArrayList(java.util.ArrayList) AgentComparator(io.nuls.consensus.poc.protocol.util.AgentComparator) AgentPo(io.nuls.consensus.poc.storage.po.AgentPo)

Aggregations

Agent (io.nuls.consensus.poc.protocol.entity.Agent)1 AgentComparator (io.nuls.consensus.poc.protocol.util.AgentComparator)1 AgentPo (io.nuls.consensus.poc.storage.po.AgentPo)1 ArrayList (java.util.ArrayList)1