本文整理汇总了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();
}
示例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"));
}
}
示例3: toString
import java.util.Arrays; //导入方法依赖的package包/类
@Override
public String toString() {
return "ExploitReport{" +
"exploits=" + Arrays.deepToString(exploits.toArray()) +
", facets=" + facets +
", total=" + total +
'}';
}
示例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));
}
示例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
+ "]";
}
示例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));
}
示例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);
}
示例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;
}
示例9: toString
import java.util.Arrays; //导入方法依赖的package包/类
@Override
public String toString() {
return Arrays.deepToString(toArray());
}
示例10: toString
import java.util.Arrays; //导入方法依赖的package包/类
@Override
public String toString() {
return Arrays.deepToString(toArray(false));
}
示例11: toString
import java.util.Arrays; //导入方法依赖的package包/类
public static String toString(Object[] objects) {
return Arrays.deepToString(objects);
}
示例12: toString
import java.util.Arrays; //导入方法依赖的package包/类
@Override
public String toString() {
return Arrays.deepToString(fields);
}
示例13: toString
import java.util.Arrays; //导入方法依赖的package包/类
@Override
public String toString(Object value) {
return Arrays.deepToString((Object[]) value);
}
示例14: toString
import java.util.Arrays; //导入方法依赖的package包/类
public String toString() {
return "HoverEvent(action=" + (Object)((Object)this.getAction()) + ", value=" + Arrays.deepToString(this.getValue()) + ")";
}
示例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
}