@SuppressWarnings("unchecked")
    private static String converter(String fieldName, Object object) {
        StringBuilder builder = new StringBuilder();
        if (Checker.isNotEmpty(fieldName)) {
            builder.append("\"").append(fieldName).append("\":");
        }
        if (object instanceof Collection) {
            List list = (List) object;
            builder.append("[");
            list.forEach(obj -> builder.append(converter(ValueConsts.EMPTY_STRING, obj)));
            return builder.substring(0, builder.length() - 1) + "],";
        } else if (object instanceof Map) {
            Map map = (Map) object;
            builder.append("{");
            map.forEach((k, v) -> builder.append(converter(k.toString(), v)));
            return builder.substring(0, builder.length() - 1) + "},";
        } else if (Checker.isEmpty(fieldName)) {
            builder.append("\"").append(object).append("\",");
        } else {
            builder.append("\"").append(object).append("\",");
        }
        return builder.toString();
    }
@ SuppressWarnings ( "unchecked" ) private static String converter ( String fieldName , Object object ) { StringBuilder builder = new StringBuilder ( ) ; if ( Checker . isNotEmpty ( fieldName ) ) { builder . append ( "\"" ) . append ( fieldName ) . append ( "\":" ) ; } if ( object instanceof Collection ) { List list = ( List ) object ; builder . append ( "[" ) ; list . forEach ( obj -> builder . append ( converter ( ValueConsts . EMPTY_STRING , obj ) ) ) ; return builder . substring ( 0 , builder . length ( ) - 1 ) + "]," ; } else if ( object instanceof Map ) { Map map = ( Map ) object ; builder . append ( "{" ) ; map . forEach ( ( k , v ) -> builder . append ( converter ( k . toString ( ) , v ) ) ) ; return builder . substring ( 0 , builder . length ( ) - 1 ) + "}," ; } else if ( Checker . isEmpty ( fieldName ) ) { builder . append ( "\"" ) . append ( object ) . append ( "\"," ) ; } else { builder . append ( "\"" ) . append ( object ) . append ( "\"," ) ; } return builder . toString ( ) ; }
手动转换 {@link List} 和 {@link Map}

@param fieldName 字段名
@param object 对象

@return json对象