Example usage for org.apache.commons.lang ObjectUtils toString

List of usage examples for org.apache.commons.lang ObjectUtils toString

Introduction

In this page you can find the example usage for org.apache.commons.lang ObjectUtils toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:com.alibaba.otter.shared.arbitrate.impl.interceptor.LogInterceptor.java

/**
 * ?//w w w  .ja v a2 s .c o m
 * 
 * @param result
 * @return
 */
protected String getResultString(Object result) {
    if (result == null) {
        return StringUtils.EMPTY;
    }

    if (result instanceof Map) { // ?map
        return getMapResultString((Map) result);
    } else if (result instanceof List) {// ?list
        return getListResultString((List) result);
    } else if (result.getClass().isArray()) {// ?array
        return getArrayResultString((Object[]) result);
    } else {
        // ?string
        return ObjectUtils.toString(result, StringUtils.EMPTY).toString();
        // return ToStringBuilder.reflectionToString(result, ToStringStyle.SIMPLE_STYLE);
    }
}