List of usage examples for java.util List toString
public String toString()
From source file:com.inkubator.securitycore.util.UserInfoUtil.java
public static String getRolesString() { List<String> roles = getRoles(); String role = roles.toString(); return role.substring(1, role.length() - 1); }
From source file:gool.executor.ExecutorHelper.java
public static String compileAndRun(Platform platform, Map<Platform, List<File>> files) throws FileNotFoundException { StringBuilder result = new StringBuilder(); List<File> compiledFiles = ExecutorHelper.compile(files); Log.i(compiledFiles.toString()); result.append(platform.getCompiler().run(compiledFiles.get(0))); return result.toString(); }
From source file:Main.java
public static void sortDates(List<DAY> dayList) { Collections.sort(dayList, new Comparator<DAY>() { public int compare(DAY day1, DAY day2) { return day1.getWeight() - day2.getWeight(); }// ww w.j a va 2 s .c o m }); System.out.println("sortedlist is" + dayList.toString()); }
From source file:com.project.atm.core.App.java
public static String findRoute(String fromLoc, String toLoc) throws FileNotFoundException { if (graph != null) { List shortest_path = DijkstraShortestPath.findPathBetween(graph, fromLoc, toLoc); if (shortest_path != null) return shortest_path.toString(); }/* w ww .j a v a2s . c o m*/ return "No Route Data"; }
From source file:edu.cornell.mannlib.vitro.webapp.controller.json.JsonServlet.java
private static IndividualListResults getSearchVClassIntersectionResults(List<String> vclassURIs, VitroRequest vreq) {/*ww w. j ava 2s. co m*/ log.debug("Retrieving search intersection results for " + vclassURIs.toString()); String alpha = IndividualListController.getAlphaParameter(vreq); int page = IndividualListController.getPageParameter(vreq); log.debug("Alpha and page parameters are " + alpha + " and " + page); try { return IndividualListController.getResultsForVClassIntersections(vclassURIs, page, INDIVIDUALS_PER_PAGE, alpha, vreq.getWebappDaoFactory().getIndividualDao()); } catch (Exception ex) { log.error("Error in retrieval of search results for VClass " + vclassURIs.toString(), ex); return IndividualListResults.EMPTY; } }
From source file:com.feilong.commons.core.util.ListUtil.java
/** * list???,[]?? ??()??,?<br>//from w w w.jav a 2 s . c om * : * * <pre> * List<String> testList = new ArrayList<String>(); * testList.add("xinge"); * testList.add("feilong"); * * toStringReplaceBrackets(testList)-----{@code >}(xinge, feilong) * </pre> * * @param list * list? * @return list???,[]?? ??()??,? */ public static String toStringReplaceBrackets(List<String> list) { return list.toString().replace('[', '(').replace(']', ')'); }
From source file:com.feilong.commons.core.util.ListUtil.java
/** * list???,[]??, <br>/* ww w . j a v a2 s. c o m*/ * : * * <pre> * {@code * * List<String> testList = new ArrayList<String>(); * testList.add("xinge"); * testList.add("feilong"); * * toStringRemoveBrackets(testList)----->xinge,feilong * } * </pre> * * @param list * list? * @return list???,[]??, */ public static String toStringRemoveBrackets(List<String> list) { String s = list.toString(); return s.substring(1, s.length() - 1).replaceAll(" ", ""); }
From source file:com.bluexml.side.util.dependencies.MavenUtil.java
public static String getCommandFromMavenExecutionArgs(List<String> args) { String rt = "mvn " + args.toString().replaceAll("[\\[\\]]", "").replace(",", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ return rt;//from w w w .j a va 2 s. c om }
From source file:org.terasology.telemetry.TelemetryEmitter.java
private static RequestCallback getDefaultRequestCallback() { return new RequestCallback() { public void onSuccess(int successCount) { logger.info("Success sent, successCount: " + successCount); }/* ww w .j a v a2s.c o m*/ public void onFailure(int successCount, List<TrackerPayload> failedEvents) { logger.warn( "Failure, successCount: " + successCount + "\nfailedEvent:\n" + failedEvents.toString()); } }; }
From source file:com.zxy.commons.lang.utils.ObjectsUtils.java
/** * ??//w w w . j ava2 s . c o m * * @param obj * @param toStringStyle ? * {@code ToStringStyle.SIMPLE_STYLE } * {@code ToStringStyle.SHORT_PREFIX_STYLE } * {@code ToStringStyle.MULTI_LINE_STYLE } * @return ?? * @see ToStringStyle */ public static String toString(Object obj, ToStringStyle toStringStyle) { if (obj == null) { return null; } if ((obj instanceof Collection)) { Collection<?> cs = (Collection<?>) obj; List<String> returnCs = new ArrayList<>(); for (Object c : cs) { returnCs.add(ReflectionToStringBuilder.toString(c, toStringStyle)); } return returnCs.toString(); } if ((obj instanceof Map)) { Map<?, ?> maps = (Map<?, ?>) obj; Map<String, String> returnMaps = new HashMap<>(); for (Map.Entry<?, ?> entry : maps.entrySet()) { String key = entry.getKey().toString(); String value = ReflectionToStringBuilder.toString(entry.getValue(), toStringStyle); returnMaps.put(key, value); } return returnMaps.toString(); } // return ReflectionToStringBuilder.toString(obj, ToStringStyle.SHORT_PREFIX_STYLE); return ReflectionToStringBuilder.toString(obj, toStringStyle); }