aio.setSetUpCost(io.getSetUpCost());
aio.setSubscribed(ioa != null); // account is subscribed simply if there is a InterfaceOptionAccount record
final LinkedHashSet<AccountInterfaceOptionParameter> aiops = new LinkedHashSet<AccountInterfaceOptionParameter>();
aio.setParameters(aiops);
for(final InterfaceOptionParameterDefinition iopd : io.getParameters()) {
final AccountInterfaceOptionParameter aiop = entityAssembler.assembleEntity(AccountInterfaceOptionParameter.class, null, false);
aiop.setId(iopd.getId());
aiop.setVersion(1); // mimic non-new entity
aiops.add(aiop);
aiop.setCode(iopd.getCode());
aiop.setName(iopd.getName());
aiop.setDescription(iopd.getDescription());
aiop.setDateCreated(iopd.getDateCreated());
aiop.setDateModified(iopd.getDateModified());
aiop.setValue(ioa == null ? null : ioa.getParameters().get(iopd.getName()));
}
return aio;
}