當前位置: 首頁>>代碼示例>>Java>>正文


Java Arrays.deepToString方法代碼示例

本文整理匯總了Java中java.util.Arrays.deepToString方法的典型用法代碼示例。如果您正苦於以下問題:Java Arrays.deepToString方法的具體用法?Java Arrays.deepToString怎麽用?Java Arrays.deepToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.Arrays的用法示例。


在下文中一共展示了Arrays.deepToString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: toString

import java.util.Arrays; //導入方法依賴的package包/類
@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();
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:18,代碼來源:ImmutableDescriptor.java

示例2: traceMethod

import java.util.Arrays; //導入方法依賴的package包/類
@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"));
    }
}
 
開發者ID:luotuo,項目名稱:cas4.0.x-server-wechat,代碼行數:25,代碼來源:LogAspect.java

示例3: toString

import java.util.Arrays; //導入方法依賴的package包/類
@Override
public String toString() {
    return "ExploitReport{" +
            "exploits=" + Arrays.deepToString(exploits.toArray()) +
            ", facets=" + facets +
            ", total=" + total +
            '}';
}
 
開發者ID:fooock,項目名稱:jshodan,代碼行數:9,代碼來源:ExploitReport.java

示例4: assertArrayEquals

import java.util.Arrays; //導入方法依賴的package包/類
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));
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:9,代碼來源:LoggerInterfaceTest.java

示例5: toString

import java.util.Arrays; //導入方法依賴的package包/類
@Override
public String toString() {
    return "AliasActions["
            + "type=" + type
            + ",indices=" + Arrays.toString(indices)
            + ",aliases=" + Arrays.deepToString(aliases)
            + ",filter=" + filter
            + ",routing=" + routing
            + ",indexRouting=" + indexRouting
            + ",searchRouting=" + searchRouting
            + "]";
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:13,代碼來源:IndicesAliasesRequest.java

示例6: assertArrayEquals

import java.util.Arrays; //導入方法依賴的package包/類
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));
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:11,代碼來源:VarargsArrayTest.java

示例7: d

import java.util.Arrays; //導入方法依賴的package包/類
@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);
}
 
開發者ID:vsona,項目名稱:RxJava2RetrofitDemo,代碼行數:11,代碼來源:LoggerPrinter.java

示例8: getRequestParameterList

import java.util.Arrays; //導入方法依賴的package包/類
/**
 * 功能:獲取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;
}
 
開發者ID:fier-liu,項目名稱:FCat,代碼行數:35,代碼來源:PathUtil.java

示例9: toString

import java.util.Arrays; //導入方法依賴的package包/類
@Override
public String toString() {
    return Arrays.deepToString(toArray());
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:5,代碼來源:PlatformLoggerBridgeTest.java

示例10: toString

import java.util.Arrays; //導入方法依賴的package包/類
@Override
public String toString() {
    return Arrays.deepToString(toArray(false));
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:5,代碼來源:BaseLoggerBridgeTest.java

示例11: toString

import java.util.Arrays; //導入方法依賴的package包/類
public static String toString(Object[] objects) {
    return Arrays.deepToString(objects);
}
 
開發者ID:fengdongfei,項目名稱:CXJPadProject,代碼行數:4,代碼來源:ConvertUtils.java

示例12: toString

import java.util.Arrays; //導入方法依賴的package包/類
@Override
public String toString() {
	return Arrays.deepToString(fields);
}
 
開發者ID:pSpaces,項目名稱:jSpace,代碼行數:5,代碼來源:Tuple.java

示例13: toString

import java.util.Arrays; //導入方法依賴的package包/類
@Override
public String toString(Object value) {
    return Arrays.deepToString((Object[]) value);
}
 
開發者ID:vladmihalcea,項目名稱:hibernate-types,代碼行數:5,代碼來源:AbstractArrayTypeDescriptor.java

示例14: toString

import java.util.Arrays; //導入方法依賴的package包/類
public String toString() {
    return "HoverEvent(action=" + (Object)((Object)this.getAction()) + ", value=" + Arrays.deepToString(this.getValue()) + ")";
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:4,代碼來源:HoverEvent.java

示例15: apply

import java.util.Arrays; //導入方法依賴的package包/類
@Override
public String apply(Object arg) {
  String s = Arrays.deepToString(new Object[] {arg});
  return s.substring(1, s.length() - 1); // cut off brackets
}
 
開發者ID:maetrive,項目名稱:businessworks,代碼行數:6,代碼來源:Annotations.java


注:本文中的java.util.Arrays.deepToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。