Java Code Examples for java.util.Arrays.deepToString()

The following are Jave code examples for showing how to use deepToString() of the java.util.Arrays class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: OpenJSharp   File: ImmutableDescriptor.java   View Source Code Vote up 6 votes
@Override
public String toString() {
    StringBuilder sb = new StringBuilder("{");
    for (int i = 0; i < names.length; i++) {
        if (i > 0)
            sb.append(", ");
        sb.append(names[i]).append("=");
        Object v = values[i];
        if (v != null && v.getClass().isArray()) {
            String s = Arrays.deepToString(new Object[] {v});
            s = s.substring(1, s.length() - 1); // remove [...]
            v = s;
        }
        sb.append(String.valueOf(v));
    }
    return sb.append("}").toString();
}
 
Example 2
Project: cas4.0.x-server-wechat   File: LogAspect.java   View Source Code Vote up 6 votes
@Around("(execution (public * org.jasig.cas..*.*(..))) && !(execution( * org.jasig.cas..*.set*(..)))")
public Object traceMethod(final ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
    Object returnVal = null;
    final Logger logger = this.getLog(proceedingJoinPoint);
    final String methodName = proceedingJoinPoint.getSignature().getName();

    try {
        if (logger.isTraceEnabled()) {
            final Object[] args = proceedingJoinPoint.getArgs();
            final String arguments;
            if (args == null || args.length == 0) {
                arguments = "";
            } else {
                arguments = Arrays.deepToString(args);
            }
            logger.trace("Entering method [{}] with arguments [{}]", methodName, arguments);
        }
        returnVal = proceedingJoinPoint.proceed();
        return returnVal;
    } finally {
        logger.trace("Leaving method [{}] with return value [{}].", methodName,
                    (returnVal != null ? returnVal.toString() : "null"));
    }
}
 
Example 3
Project: jshodan   File: ExploitReport.java   View Source Code Vote up 5 votes
@Override
public String toString() {
    return "ExploitReport{" +
            "exploits=" + Arrays.deepToString(exploits.toArray()) +
            ", facets=" + facets +
            ", total=" + total +
            '}';
}
 
Example 4
Project: openjdk-jdk10   File: LoggerInterfaceTest.java   View Source Code Vote up 5 votes
static void assertArrayEquals(Object[] actual, Object[] expected, String what, String prefix) {
    if (!Objects.deepEquals(actual, expected)) {
        throw new RuntimeException("Bad " + what + ":"
                + "\n\t expected: " + expected == null ? "null" : Arrays.deepToString(expected)
                + "\n\t   actual: " + actual == null ? "null" : Arrays.deepToString(actual));
    }
    System.out.println(prefix + "Got expected " + what + ": " + Arrays.deepToString(actual));
}
 
Example 5
Project: elasticsearch_my   File: IndicesAliasesRequest.java   View Source Code Vote up 5 votes
@Override
public String toString() {
    return "AliasActions["
            + "type=" + type
            + ",indices=" + Arrays.toString(indices)
            + ",aliases=" + Arrays.deepToString(aliases)
            + ",filter=" + filter
            + ",routing=" + routing
            + ",indexRouting=" + indexRouting
            + ",searchRouting=" + searchRouting
            + "]";
}
 
Example 6
Project: jdk8u-jdk   File: VarargsArrayTest.java   View Source Code Vote up 5 votes
public static void assertArrayEquals(Object[] arr1, Object[] arr2) {
    if (arr1 == null && arr2 == null)  return;
    if (arr1 != null && arr2 != null && arr1.length == arr2.length) {
        for (int i = 0; i < arr1.length; i++) {
            assertEquals(arr1[i], arr2[i]);
        }
        return;
    }
    throw new AssertionError(Arrays.deepToString(arr1) + " != " + Arrays.deepToString(arr2));
}
 
Example 7
Project: RxJava2RetrofitDemo   File: LoggerPrinter.java   View Source Code Vote up 5 votes
@Override
public void d(Object object) {
  String message;
  if (object.getClass().isArray()) {
    message = Arrays.deepToString((Object[]) object);
  } else {
    message = object.toString();
  }
  log(DEBUG, null, message);
}
 
Example 8
Project: FCat   File: PathUtil.java   View Source Code Vote up 5 votes
/**
 * 功能:获取Post的参数串
 * 
 * @param request
 * @return 返回一个数组,值如下: abc=12 def=34 ... hij=xx
 */
public static List<String> getRequestParameterList(HttpServletRequest request) {
	Map<String, String[]> parameterMap = request.getParameterMap();
	List<String> resultList;
	Set<Entry<String, String[]>> parameterSet = parameterMap.entrySet();
	if (parameterSet == null || parameterSet.isEmpty()) {
		return Collections.emptyList();
	}
	resultList = new ArrayList<String>();
	String value;
	for (Iterator<Entry<String, String[]>> iterator = parameterSet.iterator(); iterator.hasNext();) {
		Entry<String, String[]> entry = iterator.next();
		String key = entry.getKey();
		String[] valueObject = entry.getValue();

		if (valueObject == null) {
			value = "";
		} else  {
			String[] valueArr = valueObject;
			if (valueArr.length == 1) {
				value = valueArr[0];
			} else {
				value = Arrays.deepToString((String[]) valueObject);
			}
		} 
		resultList.add(key + "=" + value);
	}
	return resultList;
}
 
Example 9
Project: openjdk-jdk10   File: PlatformLoggerBridgeTest.java   View Source Code Vote up 4 votes
@Override
public String toString() {
    return Arrays.deepToString(toArray());
}
 
Example 10
Project: openjdk-jdk10   File: DefaultLoggerTest.java   View Source Code Vote up 4 votes
@Override
public String toString() {
    return Arrays.deepToString(toArray());
}
 
Example 11
Project: openjdk-jdk10   File: BaseLoggerBridgeTest.java   View Source Code Vote up 4 votes
@Override
public String toString() {
    return Arrays.deepToString(toArray(false));
}
 
Example 12
Project: CXJPadProject   File: ConvertUtils.java   View Source Code Vote up 4 votes
public static String toString(Object[] objects) {
    return Arrays.deepToString(objects);
}
 
Example 13
Project: jSpace   File: Tuple.java   View Source Code Vote up 4 votes
@Override
public String toString() {
	return Arrays.deepToString(fields);
}
 
Example 14
Project: hibernate-types   File: AbstractArrayTypeDescriptor.java   View Source Code Vote up 4 votes
@Override
public String toString(Object value) {
    return Arrays.deepToString((Object[]) value);
}
 
Example 15
Project: Uranium   File: HoverEvent.java   View Source Code Vote up 4 votes
public String toString() {
    return "HoverEvent(action=" + (Object)((Object)this.getAction()) + ", value=" + Arrays.deepToString(this.getValue()) + ")";
}
 
Example 16
Project: businessworks   File: Annotations.java   View Source Code Vote up 4 votes
@Override
public String apply(Object arg) {
  String s = Arrays.deepToString(new Object[] {arg});
  return s.substring(1, s.length() - 1); // cut off brackets
}
 
Example 17
Project: SKIL_Examples   File: Knn.java   View Source Code Vote up 4 votes
public String toString() {
    return "results{" + Arrays.deepToString(this.results.toArray()) + "}";
}
 
Example 18
Project: hibernate-types   File: AbstractArrayTypeDescriptor.java   View Source Code Vote up 4 votes
@Override
public String toString(Object value) {
    return Arrays.deepToString((Object[]) value);
}
 
Example 19
Project: openjdk-jdk10   File: TestLoggerFinder.java   View Source Code Vote up 4 votes
@Override
public String toString() {
    return Arrays.deepToString(toArray());
}
 
Example 20
Project: MainCalendar   File: ConvertUtils.java   View Source Code Vote up 2 votes
/**
 * To string string.
 *
 * @param objects the objects
 * @return the string
 */
public static String toString(Object[] objects) {
    return Arrays.deepToString(objects);
}