List of usage examples for java.util List toString
public String toString()
From source file:eu.itesla_project.online.tools.ListOnlineWorkflowStatesTool.java
@Override public void run(CommandLine line) throws Exception { OnlineConfig config = OnlineConfig.load(); OnlineDb onlinedb = config.getOnlineDbFactoryClass().newInstance().create(); String workflowId = line.getOptionValue("workflow"); List<Integer> storedStates = onlinedb.listStoredStates(workflowId); if (storedStates != null) { if (!storedStates.isEmpty()) { System.out.println("Stored States = " + storedStates.toString()); } else/* ww w . j a v a 2 s. co m*/ System.out.println("No stores states for this workflow"); } else System.out.println("No stores states for this workflow"); onlinedb.close(); }
From source file:com.unito.model.repository.SemTElemRepository.java
public List<SemTElem> getAllElements() { List<SemTElem> retVal = jdbcTemplate.query(SELECT_ALL_ELEMENTS, (new SemTElemRepository.SemTElemMapper<>())); LOG.info("getAllElements: " + retVal == null ? "null" : retVal.toString()); return retVal; }
From source file:com.unito.model.repository.SemTElemRepository.java
public List<SemTElem> getElementsOnTable(Table table) { List<SemTElem> retVal = jdbcTemplate.query(SELECT_ALL_ELEMENTS_ON_TABLE, (new SemTElemRepository.SemTElemMapper<>()), table.getID()); LOG.info(retVal == null ? "null" : retVal.toString()); return retVal; }
From source file:ru.org.linux.topic.TopicTagService.java
/** * ?? ?? ??./*from w w w . ja v a 2 s. com*/ * * @param msgId ?? * @param tagList ?? . * @return true ? ? */ @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) public synchronized boolean updateTags(final int msgId, final List<String> tagList) { logger.debug(" ?? [" + tagList.toString() + "] ? msgId=" + msgId); final List<String> oldTags = getMessageTags(msgId); boolean modified = false; for (String tag : tagList) { if (!oldTags.contains(tag)) { int id = tagService.getOrCreateTag(tag); logger.trace(" '" + tag + "' msgId=" + msgId); topicTagDao.addTag(msgId, id); modified = true; } } for (String tag : oldTags) { if (!tagList.contains(tag)) { int id = tagService.getOrCreateTag(tag); logger.trace(" '" + tag + "' msgId=" + msgId); topicTagDao.deleteTag(msgId, id); modified = true; } } logger.trace(": ?? ? msgId=" + msgId); return modified; }
From source file:com.legstar.cobol.AbstractCobolTester.java
/** * Starting from a COBOL source fragment translates to XML Schema. * @param source COBOL source fragment.// w w w . ja va 2 s .c o m * @return an XML Schema * @throws RecognizerException if emit fails */ public String emit(final String source) throws RecognizerException { try { CommonTree ast = parse(source); if (_log.isDebugEnabled()) { _log.debug(ast.toStringTree()); } TreeNodeStream nodes = new CommonTreeNodeStream(ast); CobolStructureEmitter emitter = new CobolStructureEmitterImpl(nodes, getErrorHandler()); List<CobolDataItem> dataEntries = new ArrayList<CobolDataItem>(); emitter.cobdata(dataEntries); return dataEntries.toString(); } catch (RecognitionException e) { throw new RecognizerException(e); } }
From source file:com.jfaker.framework.flow.web.TaskController.java
/** * /*from w ww. ja v a 2 s. c o m*/ */ public void activeCCMore() { Page<HistoryOrder> page = new Page<HistoryOrder>(); page.setPageNo(getParaToInt("pageNo", 1)); List<String> list = ShiroUtils.getGroups(); list.add(ShiroUtils.getUsername()); log.info(list.toString()); String[] assignees = new String[list.size()]; list.toArray(assignees); engine.query().getCCWorks(page, new QueryFilter().setOperators(assignees).setState(1)); setAttr("page", page); render("activeCCMore.jsp"); }
From source file:org.openmrs.module.lfhcforms.fragment.controller.visit.VisitStartFragmentController.java
/** * // www .j a v a 2 s.com * Saves visit with a visit type provided by the view * */ public FragmentActionResult create(@RequestParam("patientId") Patient patient, @RequestParam("selectedType") VisitType selectedType, UiUtils uiUtils, UiSessionContext uiContext, HttpServletRequest request, @SpringBean("adtService") AdtService adtService, @SpringBean("visitService") VisitService visitService, @SpringBean("visitHelper") VisitHelper visitHelper, @SpringBean("visitTypeHelper") VisitTypeHelper visitTypeHelper) { // Do not save if patient already has active visit, in any location List<Visit> activeVisits = visitHelper.getActiveVisits(patient, adtService); if (activeVisits.size() != 0) { log.warn("Patient already has active visits. " + activeVisits.toString()); return new FailureResult(uiUtils.message("coreapps.activeVisits.alreadyExists")); } // create the visit Visit visit = adtService.ensureVisit(patient, new Date(), uiContext.getSessionLocation()); // set the visit type visit.setVisitType(selectedType); visitService.saveVisit(visit); Location loginLocation = uiContext.getSessionLocation(); visitTypeHelper.setEncounterBasedOnVisitType(visit, loginLocation); request.getSession().setAttribute(AppUiConstants.SESSION_ATTRIBUTE_INFO_MESSAGE, uiUtils.message("coreapps.visit.createQuickVisit.successMessage", uiUtils.format(patient))); request.getSession().setAttribute(AppUiConstants.SESSION_ATTRIBUTE_TOAST_MESSAGE, "true"); return new SuccessResult(); }
From source file:com.jfaker.framework.flow.web.TaskController.java
/** * //w w w . j av a 2s. c o m */ public void activeMore() { Page<WorkItem> page = new Page<WorkItem>(); page.setPageNo(getParaToInt("pageNo", 1)); List<String> list = ShiroUtils.getGroups(); list.add(ShiroUtils.getUsername()); log.info(list.toString()); String[] assignees = new String[list.size()]; list.toArray(assignees); int taskType = getParaToInt("taskType"); engine.query().getWorkItems(page, new QueryFilter().setOperators(assignees).setTaskType(taskType)); setAttr("page", page); setAttr("taskType", taskType); render("activeTaskMore.jsp"); }
From source file:org.smigo.species.SpeciesHandler.java
public void deleteSpecies(int deleteId, int replaceId) { if (replaceId != 0) { List<Plant> restore = plantHandler.getPlants(deleteId); mailHandler.sendAdminNotification("plants replaced", "Old:" + deleteId + " New:" + replaceId + System.lineSeparator() + restore.toString()); plantHandler.replaceSpecies(deleteId, replaceId); }//from w w w. ja va 2s . c o m speciesDao.deleteSpecies(deleteId); }
From source file:dk.netarkivet.archive.arcrepositoryadmin.ReplicaCacheHelpers.java
/** * Method for finding the checksum which is present most times in the * list.//from w w w .j ava2 s . co m * * @param checksums The list of checksum to vote about. * @return The most common checksum, or null if several exists. */ protected static String vote(List<String> checksums) { log.debug("voting for checksums: " + checksums.toString()); // count the occurrences of each unique checksum. Map<String, Integer> csMap = new HashMap<String, Integer>(); for (String cs : checksums) { if (csMap.containsKey(cs)) { // count one more! Integer count = csMap.get(cs) + 1; csMap.put(cs, count); } else { csMap.put(cs, 1); } } // find the checksum with the largest count. int largestCount = -1; boolean unique = false; String checksum = null; for (Map.Entry<String, Integer> entry : csMap.entrySet()) { if (entry.getValue() > largestCount) { largestCount = entry.getValue(); checksum = entry.getKey(); unique = true; } else if (entry.getValue() == largestCount) { unique = false; } } // if not unique, then log an error and return null! if (!unique) { log.error("No checksum has the most occurrences in '" + csMap + "'. A null has been returned!"); return null; } return checksum; }