List of usage examples for org.apache.commons.lang.builder ToStringStyle MULTI_LINE_STYLE
ToStringStyle MULTI_LINE_STYLE
To view the source code for org.apache.commons.lang.builder ToStringStyle MULTI_LINE_STYLE.
Click Source Link
From source file:com.google.cloud.vision.v1.ImageAnnotatorSmokeTest.java
public static void executeNoCatch() throws Exception { try (ImageAnnotatorClient client = ImageAnnotatorClient.create()) { String gcsImageUri = "gs://gapic-toolkit/President_Barack_Obama.jpg"; ImageSource source = ImageSource.newBuilder().setGcsImageUri(gcsImageUri).build(); Image image = Image.newBuilder().setSource(source).build(); Feature.Type type = Feature.Type.FACE_DETECTION; Feature featuresElement = Feature.newBuilder().setType(type).build(); List<Feature> features = Arrays.asList(featuresElement); AnnotateImageRequest requestsElement = AnnotateImageRequest.newBuilder().setImage(image) .addAllFeatures(features).build(); List<AnnotateImageRequest> requests = Arrays.asList(requestsElement); BatchAnnotateImagesResponse response = client.batchAnnotateImages(requests); System.out.println(ReflectionToStringBuilder.toString(response, ToStringStyle.MULTI_LINE_STYLE)); }//from ww w . j av a 2s . com }
From source file:com.gemini.domain.repository.impl.GeminiApplicationRepositoryMongoDBImpl.java
public GeminiApplication getAppByName(String appName) { Logger.debug("get app by name :{}", ToStringBuilder.reflectionToString(appName, ToStringStyle.MULTI_LINE_STYLE)); return findOne(getDatastore().createQuery(GeminiApplication.class).filter("name", appName)); }
From source file:com.gemini.mapper.IPAddressCustomConverter.java
@Override public Object convert(Object destValue, Object sourceValue, Class<?> destClass, Class<?> sourceClass) throws MappingException { if (sourceValue == null) { Logger.error("IP Address Custom Converter used incorrectly, NULL values passed"); return null; }// w ww. j a v a2 s. co m if (sourceValue instanceof String) { InetAddress dest = InetAddresses.forString((String) sourceValue); return dest; } else if (sourceValue instanceof InetAddress) { return ((InetAddress) sourceValue).getHostAddress(); } else { Logger.error( "IP Address Custom Converter used incorrectly. Arguments passed in were: source\n {} \n destination\n {}", ToStringBuilder.reflectionToString(sourceValue, ToStringStyle.MULTI_LINE_STYLE), ToStringBuilder.reflectionToString(destValue, ToStringStyle.MULTI_LINE_STYLE)); throw new MappingException("Converter TestCustomConverter used incorrectly. Arguments passed in were:" + ToStringBuilder.reflectionToString(destValue, ToStringStyle.MULTI_LINE_STYLE) + " and " + ToStringBuilder.reflectionToString(sourceValue, ToStringStyle.MULTI_LINE_STYLE)); } }
From source file:elaborate.editor.solr.ElaborateEditorSearchParameters.java
@Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE, false); }
From source file:com.gemini.mapper.ProtocolCustomConverter.java
@Override public Object convert(Object destValue, Object sourceValue, Class<?> destinationClass, Class<?> sourceClass) { if (sourceValue == null) { Logger.error("Protocol Custom Converter used incorrectly, NULL values passed"); return null; }/*from w ww .jav a 2 s .co m*/ if (sourceValue instanceof String) { //convert String to GeminiEnvironmentType for (Protocol protocol : Protocol.values()) { if (protocol.name().equals((String) sourceValue)) { return protocol; } } } else if (sourceValue instanceof Protocol) { return ((Protocol) sourceValue).name(); } else { Logger.error( "Protocol Custom Converter used incorrectly. Arguments passed in were: source\n {} \n destination\n {}", ToStringBuilder.reflectionToString(sourceValue, ToStringStyle.MULTI_LINE_STYLE), ToStringBuilder.reflectionToString(destValue, ToStringStyle.MULTI_LINE_STYLE)); throw new MappingException("Protocol Converter used incorrectly. Arguments passed in were:" + ToStringBuilder.reflectionToString(destValue, ToStringStyle.MULTI_LINE_STYLE) + " and " + ToStringBuilder.reflectionToString(sourceValue, ToStringStyle.MULTI_LINE_STYLE)); } return null; }
From source file:com.enonic.cms.core.AdminSiteDebugBasePath.java
public String toString() { ToStringBuilder s = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE); s.append("adminPath", adminPath.toString()); s.append("siteKey", siteKey.toString()); s.append("asPath", asPath.toString()); return s.toString(); }
From source file:com.gemini.common.repository.impl.BaseRepositoryMongoDBImpl.java
@Override public List<T> list() { Logger.debug("list-find:{}", ToStringBuilder.reflectionToString(type.getSimpleName(), ToStringStyle.MULTI_LINE_STYLE)); return getDatastore().createQuery(type).asList(); }
From source file:com.pieframework.model.resources.Resource.java
@Override public String toString() { // TODO Auto-generated method stub ReflectionToStringBuilder.setDefaultStyle(ToStringStyle.MULTI_LINE_STYLE); return ReflectionToStringBuilder.toString(this); }
From source file:com.gemini.mapper.EnvironmentTypeCustomConverter.java
@Override public Object convert(Object destValue, Object sourceValue, Class<?> destinationClass, Class<?> sourceClass) { if (sourceValue == null) { Logger.error("Environment Type Custom Converter used incorrectly, NULL values passed"); return null; }/*from w ww .j av a 2s.c o m*/ if (sourceValue instanceof String) { //convert String to GeminiEnvironmentType for (GeminiEnvironmentType envType : GeminiEnvironmentType.values()) { if (envType.name().equals((String) sourceValue)) { return envType; } } } else if (sourceValue instanceof InetAddress) { return ((GeminiEnvironmentType) sourceValue).name(); } else { Logger.error( "IP Address Custom Converter used incorrectly. Arguments passed in were: source\n {} \n destination\n {}", ToStringBuilder.reflectionToString(sourceValue, ToStringStyle.MULTI_LINE_STYLE), ToStringBuilder.reflectionToString(destValue, ToStringStyle.MULTI_LINE_STYLE)); throw new MappingException("Converter TestCustomConverter used incorrectly. Arguments passed in were:" + ToStringBuilder.reflectionToString(destValue, ToStringStyle.MULTI_LINE_STYLE) + " and " + ToStringBuilder.reflectionToString(sourceValue, ToStringStyle.MULTI_LINE_STYLE)); } return null; }
From source file:ReflectionBuilderTrial.java
public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); }