List of usage examples for org.apache.commons.lang.builder ToStringStyle NO_FIELD_NAMES_STYLE
ToStringStyle NO_FIELD_NAMES_STYLE
To view the source code for org.apache.commons.lang.builder ToStringStyle NO_FIELD_NAMES_STYLE.
Click Source Link
From source file:com.all.downloader.download.DownloadStatusImpl.java
@Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.NO_FIELD_NAMES_STYLE); }
From source file:com.all.download.manager.download.ManagedDownload.java
@Override public synchronized void onSearchSources(SearchSourcesEvent searchSourcesEvent) { ManagedDownloader downloader = searchSourcesEvent.getDownloader(); if (selectedDownloader == null) { log.debug("searchedSourcesResult received for " + ToStringBuilder.reflectionToString(searchSourcesEvent, ToStringStyle.NO_FIELD_NAMES_STYLE) + ToStringBuilder.reflectionToString(searchSourcesEvent.getDownloadStatus(), ToStringStyle.NO_FIELD_NAMES_STYLE)); DownloadStatus downloadStatus = searchSourcesEvent.getDownloadStatus(); boolean validEvent = processSearchSourcesEvent(downloadStatus, downloader); if (!validEvent) { return; }/*from w w w . jav a2 s.co m*/ findDownloaderCandidate(downloadStatus); } else { log.warn(String.format( "Ignoring event from managedDownloader[%s] since download is already in progress", downloader)); } }
From source file:com.likethecolor.alchemy.api.entity.HeaderAlchemyEntityTest.java
@Test public void testToString_Formatted() { final ToStringStyle style = ToStringStyle.NO_FIELD_NAMES_STYLE; final String language = "english"; final Response.STATUS status = Response.STATUS.OK; final String statusInfo = "invalid-api-key"; final String text = "Some sort of text"; final String url = "http://www.cnn.com/2009/CRIME/01/13/missing.pilot/index.html"; final String usage = "By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use: http://www.alchemyapi.com/company/terms.html"; final HeaderAlchemyEntity headerAlchemyEntity = new HeaderAlchemyEntity(); headerAlchemyEntity.setLanguage(language); headerAlchemyEntity.setStatus(status.toString()); headerAlchemyEntity.setStatusInfo(statusInfo); headerAlchemyEntity.setText(text);//from w w w.ja va 2 s .c om headerAlchemyEntity.setURL(url); headerAlchemyEntity.setUsage(usage); final String expectedString = new ToStringBuilder(headerAlchemyEntity, style).append("language", language) .append("status", status).append("text", text).append("url", url).append("usage", usage).toString(); final String actualString = headerAlchemyEntity.toString(style); assertEquals(expectedString, actualString); }
From source file:com.likethecolor.alchemy.api.entity.ResponseTest.java
@Test public void testToString_Formatted() { final ToStringStyle style = ToStringStyle.NO_FIELD_NAMES_STYLE; final String language = "english"; final Response.STATUS status = Response.STATUS.OK; final String statusInfo = "invalid-api-key"; final String text = "Some sort of text"; final String url = "http://www.cnn.com/2009/CRIME/01/13/missing.pilot/index.html"; final String usage = "By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use: http://www.alchemyapi.com/company/terms.html"; final boolean expectedIsConfident0 = true; final Double expectedScore0 = 0.805279D; final String expectedLabel0 = "George_W._Bush"; final boolean expectedIsConfident1 = false; final Double expectedScore1 = 0.765733D; final String expectedLabel1 = "Inauguration_of_Barack_Obama"; final boolean expectedIsConfident2 = true; final Double expectedScore2 = 0.971001D; final String expectedLabel2 = "Barack_Obama"; final TaxonomyAlchemyEntity entity0 = new TaxonomyAlchemyEntity(expectedLabel0, expectedScore0, expectedIsConfident0);/*from w w w. j a v a 2 s . co m*/ final TaxonomyAlchemyEntity entity1 = new TaxonomyAlchemyEntity(expectedLabel1, expectedScore1, expectedIsConfident1); final TaxonomyAlchemyEntity entity2 = new TaxonomyAlchemyEntity(expectedLabel2, expectedScore2, expectedIsConfident2); final Response<TaxonomyAlchemyEntity> response = new Response<TaxonomyAlchemyEntity>(); response.setLanguage(language); response.setStatus(status.toString()); response.setStatusInfo(statusInfo); response.setText(text); response.setURL(url); response.setUsage(usage); response.addEntity(entity0); response.addEntity(entity1); response.addEntity(entity2); final List<TaxonomyAlchemyEntity> entities = new ArrayList<TaxonomyAlchemyEntity>(3); entities.add(entity2); entities.add(entity0); entities.add(entity1); final String expectedString = new ToStringBuilder(response, style).append("language", language) .append("status", status).append("text", text).append("url", url).append("usage", usage) .append("entities", entities).toString(); final String actualString = response.toString(style); assertEquals(expectedString, actualString); }
From source file:org.anon.gui.BackingBase.java
@Override public String toString() { try {/*from w w w.j ava 2 s .com*/ return ReflectionToStringBuilder.toString(this, ToStringStyle.NO_FIELD_NAMES_STYLE); } catch (Exception e) { String message = "Failed toString on " + this.getClass().getName(); logInfo(message); return message; } }
From source file:org.eclipse.gyrex.cloud.internal.admin.NodeDescriptor.java
@Override public String toString() { return new ToStringBuilder(this, ToStringStyle.NO_FIELD_NAMES_STYLE).append("id", nodeId) .append("approved", approved).append("info", info).toString(); }
From source file:org.eclipse.gyrex.cloud.internal.zk.ZooKeeperNodeInfo.java
@Override public String toString() { return new ToStringBuilder(this, ToStringStyle.NO_FIELD_NAMES_STYLE).append("id", nodeId) .append("name", name).append("location", location).append("tags", tags).toString(); }