本文整理匯總了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
}