List of usage examples for java.util List toString
public String toString()
From source file:de.langmi.spring.batch.examples.complex.skip.simple.SkipJobListener.java
@Override public void beforeWrite(List<? extends String> items) { LOG.debug("before write:" + items.toString()); }
From source file:com.opengamma.bbg.util.BloombergDataUtils.java
public static Set<String> getIndexMembers(final ReferenceDataProvider refDataProvider, final String indexTicker) { final Set<String> result = new TreeSet<String>(); final Set<String> bbgFields = new HashSet<String>(); bbgFields.add("INDX_MEMBERS"); bbgFields.add("INDX_MEMBERS2"); bbgFields.add("INDX_MEMBERS3"); final ReferenceDataProviderGetRequest dataRequest = ReferenceDataProviderGetRequest.createGet(indexTicker, bbgFields, true);//from w w w . j a va 2 s . c om final ReferenceDataProviderGetResult dataResult = refDataProvider.getReferenceData(dataRequest); final ReferenceData perSecResult = dataResult.getReferenceData(indexTicker); if (perSecResult.isIdentifierError()) { final List<ReferenceDataError> errors = perSecResult.getErrors(); if (!errors.isEmpty()) { s_logger.warn("Unable to lookup Index {} members because of exceptions {}", indexTicker, errors.toString()); throw new OpenGammaRuntimeException( "Unable to lookup Index members because of exceptions " + errors.toString()); } } addIndexMembers(result, perSecResult, "INDX_MEMBERS"); addIndexMembers(result, perSecResult, "INDX_MEMBERS2"); addIndexMembers(result, perSecResult, "INDX_MEMBERS3"); return result; }
From source file:com.thoughtworks.go.server.functional.helpers.CSVResponse.java
public boolean containsRow(String... rows) { List<String> targetRows = null; for (String row : this.allRows) { targetRows = Arrays.asList(rows); List<String> storedRows = Arrays.asList(row.split(",")); if (StringUtils.contains(storedRows.toString(), targetRows.toString())) { return true; }/*from ww w . j a va2s. c o m*/ } throw new RuntimeException("Failed to find " + targetRows + " in all allColumns " + this.allRows); }
From source file:com.world.watch.worldwatchcron.util.PushToUser.java
public static void push(List<String> data, String userId) { try {/*from ww w .j ava 2 s.com*/ InputStream jsonStream = PushToUser.class.getResourceAsStream("/parsePush.json"); ObjectMapper mapper = new ObjectMapper(); PushData push = mapper.readValue(jsonStream, PushData.class); push.getWhere().setUsername(userId); push.getData().setKeywords(data); String json = mapper.writeValueAsString(push); HttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(RequestConfig.custom().build()) .build(); HttpPost post = new HttpPost(URL); post.setHeader("X-Parse-Application-Id", "WhqWj009luOxOtIH3rM9iWJICLdf0NKbgqdaui8Q"); post.setHeader("X-Parse-REST-API-Key", "lThhKObAz1Tkt092Cl1HeZv4KLUsdATvscOaGN2y"); post.setHeader("Content-Type", "application/json"); logger.debug("JSON to push {}", json.toString()); StringEntity strEntity = new StringEntity(json); post.setEntity(strEntity); httpClient.execute(post); logger.debug("Pushed {} to userId {}", data.toString(), userId); } catch (Exception ex) { logger.error("Push Failed for {} ", userId, ex); } }
From source file:dk.netarkivet.common.utils.DBUtils.java
/** Return a description of where an object is used elsewhere in the * database, or null./* ww w. j a v a 2 s.c o m*/ * * NB: the provided connection is not closed. * * @param connection connection to the database. * @param select A select statement finding the names of other uses. The * statement should result in exactly one column of string values. * @param victim The object being used. * @param args Any objects that may be used to prepare the select statement. * @return A string describing the usages, or null if no usages were found. */ public static String getUsages(Connection connection, String select, Object victim, Object... args) { ArgumentNotValid.checkNotNull(connection, "Connection connection"); PreparedStatement s = null; try { s = prepareStatement(connection, select, args); ResultSet res = s.executeQuery(); if (res.next()) { List<String> usedIn = new ArrayList<String>(); do { usedIn.add(res.getString(1)); } while (res.next()); return usedIn.toString(); } return null; } catch (SQLException e) { final String message = "SQL error checking for usages of " + victim + "\n" + ExceptionUtils.getSQLExceptionCause(e); log.warn(message, e); throw new IOFailure(message, e); } finally { closeStatementIfOpen(s); } }
From source file:com.skplanet.payment.sample.controller.SampleController.java
/** * Simply selects the home view to render by returning its name. */// w w w. ja va 2s.c om @RequestMapping(value = "/", method = RequestMethod.GET) public String home(Locale locale, Model model) { logger.info("Welcome home! The client locale is {}.", locale); Date date = new Date(); DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale); String formattedDate = dateFormat.format(date); model.addAttribute("serverTime", formattedDate); List<HashMap<String, String>> outputs = sqlSession.selectList("userControlMapper.selectSample"); model.addAttribute("showDB", outputs.toString()); return "home"; }
From source file:com.himanshu.poc.h2.spring.H2WithSpringTest.java
@Test public void testPersonDao() { logger.info("personDao " + personDao); Assert.assertNotNull(personDao);// w w w. j av a 2 s. co m List<String> names = personDao.getNames(); Assert.assertNotNull(names); Assert.assertTrue(names.size() == 3); logger.info(names.toString()); }
From source file:guru.bubl.module.model.User.java
public User setPreferredLocales(List<Locale> preferredLocales) { this.preferredLocales = preferredLocales.toString(); return this; }
From source file:com.himanshu.poc.h2.spring.H2WithSpringTest.java
@Test public void testDummyTableDao() { logger.info("dummyTblDao " + dummyTblDao); Assert.assertNotNull(dummyTblDao);/* w w w .j a va2 s . com*/ List<String> names = dummyTblDao.getNames(); Assert.assertNotNull(names); Assert.assertTrue(names.size() == 3); logger.info(names.toString()); }
From source file:org.hdiv.web.servlet.view.DummyMacroRequestContext.java
/** * @see org.springframework.web.servlet.support.RequestContext#getMessage(String, List) *//* www . j a v a 2 s. c om*/ public String getMessage(String code, List args) { return ((String) this.messageMap.get(code)) + args.toString(); }