@Override public void setEntityInfo(int[] chainIndices, String sequence, String description, String type) { // First get the chains EntityInfo entityInfo = new EntityInfo(); entityInfo.setDescription(description); entityInfo.setType(EntityType.entityTypeFromString(type)); List<Chain> chains = new ArrayList<>(); // Now loop through the chain ids and make a list of them for( int index : chainIndices) { chains.add(chainList.get(index)); chainList.get(index).setEntityInfo(entityInfo); chainSequenceMap.put(chainList.get(index).getId(), sequence); } entityInfo.setChains(chains); entityInfoList.add(entityInfo); }