取得结果字符串

@param result
@return
333917
protected String getResultString(Object result) {
        if (result == null) {
            return StringUtils.EMPTY;
        }

        if (result instanceof Map) { // 处理map
            return getMapResultString((Map) result);
        } else if (result instanceof List) {// 处理list
            return getListResultString((List) result);
        } else if (result.getClass().isArray()) {// 处理array
            return getArrayResultString((Object[]) result);
        } else {
            // 直接处理string
            return ObjectUtils.toString(result, StringUtils.EMPTY).toString();
            // return ToStringBuilder.reflectionToString(result, ToStringStyle.SIMPLE_STYLE);
        }
    }
90967
private static List<Map<String, Object>> handleResultSetToMapList(ResultSet result,
                                                                      List<Map<String, Object>> listProperties)
            throws SQLException {
        // 存放记录的信息
        Map<String, Object> property = null;

        // 获取结果集中的列名
        List<String> listColumns = DBUtils.getColumnLabels(result);

        // 存放记录
        while (result.next()) {
            property = new HashMap<String, Object>();
            // 将每条记录的列以及相应的列值存入一个Map对象中
            for (int i = 0; i < listColumns.size(); i++) {
                property.put(listColumns.get(i), result.getObject(i + 1));
            }
            // 将存入记录的每个map对象放入数组中
            listProperties.add(property);
        }
        return listProperties;
    }
652925
public final IResultFunction create (final String result) {

        if (result.compareTo(RESULT_AND) == 0) {
            return new AndResultFunction();
        } else if (result.compareTo(RESULT_OR) == 0) {
            return new OrResultFunction();
        } else if (result.compareTo(RESULT_MIN) == 0) {
            return new MinResultFunction();
        } else if (result.compareTo(RESULT_MAX) == 0) {
            return new MaxResultFunction();
        } else if (result.compareTo(RESULT_CHOOSE) == 0) {
            return new ChooseResultFunction();
        } else if (result.compareTo(RESULT_NONE) == 0) {
            return new NoneResultFunction();
        } else {
            throw new UnsupportedOperationException();
        }
    }
968536
protected String getCrid(Map result) {

        HashMap mgnData = getObjectOr(result, "management", new HashMap());
        ArrayList<HashMap> events = getObjectOr(mgnData, "events", new ArrayList());
        String crid = null;
        boolean isPlEventExist = false;
        for (HashMap event : events) {
            if ("planting".equals(event.get("event"))) {
                isPlEventExist = true;
                if (crid == null) {
                    crid = (String) event.get("crid");
                } else if (!crid.equals(event.get("crid"))) {
                    return "SQ";
                }
            }
        }
        if (crid == null) {
            crid = getValueOr(result, "crid", "XX");
        }
        if (!isPlEventExist && "XX".equals(crid)) {
            return "FA";
        } else {
//            DssatCRIDHelper crids = new DssatCRIDHelper();
            return DssatCRIDHelper.get2BitCrid(crid);
        }
    }
528154
public static Map<String, String> convertResultStringToMap(String result) {
		Map<String, String> map = null;

		if (StringUtils.isNotBlank(result)) {
			if (result.startsWith("{") && result.endsWith("}")) {
				result = result.substring(1, result.length() - 1);
			}
			map = parseQString(result);
		}

		return map;
	}
1086075
@Override
    public void onConnectionFailed(ConnectionResult result) {
        timeoutHandler.removeMessages(APICLIENT_TIMEOUT_HANDLE_MSG);

        if (result == null) {
            HMSAgentLog.e("result is null");
            onConnectEnd(HMSAgent.AgentResultCode.RESULT_IS_NULL);
            return;
        }

        int errCode = result.getErrorCode();
        HMSAgentLog.d("errCode=" + errCode + " allowResolve=" + allowResolveConnectError);

        if(HuaweiApiAvailability.getInstance().isUserResolvableError(errCode) && allowResolveConnectError) {
            Activity activity = ActivityMgr.INST.getLastActivity();
            if (activity != null) {
                try {
                    timeoutHandler.sendEmptyMessageDelayed(APICLIENT_STARTACTIVITY_TIMEOUT_HANDLE_MSG, APICLIENT_STARTACTIVITY_TIMEOUT);
                    Intent intent = new Intent(activity, HMSAgentActivity.class);
                    intent.putExtra(HMSAgentActivity.CONN_ERR_CODE_TAG, errCode);
                    intent.putExtra(BaseAgentActivity.EXTRA_IS_FULLSCREEN, UIUtils.isActivityFullscreen(activity));
                    activity.startActivity(intent);
                    return;
                } catch (Exception e) {
                    HMSAgentLog.e("start HMSAgentActivity exception:" + e.getMessage());
                    timeoutHandler.removeMessages(APICLIENT_STARTACTIVITY_TIMEOUT_HANDLE_MSG);
                    onConnectEnd(HMSAgent.AgentResultCode.START_ACTIVITY_ERROR);
                    return;
                }
            } else {
                // 当前没有界面处理不了错误
                HMSAgentLog.d("no activity");
                onConnectEnd(HMSAgent.AgentResultCode.NO_ACTIVITY_FOR_USE);
                return;
            }
        } else {
            //其他错误码直接透传
        }

        onConnectEnd(errCode);
    }
735368
private void disposeSignInResult(SignInResult result) {
        if (result == null) {
            HMSAgentLog.e("result is null");
            onSignInResult(HMSAgent.AgentResultCode.RESULT_IS_NULL, null);
            return;
        }

        Status status = result.getStatus();
        if (status == null) {
            HMSAgentLog.e("status is null");
            onSignInResult(HMSAgent.AgentResultCode.STATUS_IS_NULL, null);
            return;
        }

        int rstCode = status.getStatusCode();
        HMSAgentLog.d("status=" + status);
        // 需要重试的错误码，并且可以重试
        if ((rstCode == CommonCode.ErrorCode.SESSION_INVALID
                || rstCode == CommonCode.ErrorCode.CLIENT_API_INVALID) && retryTimes > 0) {
            retryTimes--;
            connect();
        } else {
            disposeObtainedResult(result, rstCode);
        }
    }
727342
private static List<String> getResultIds(JsonNode result)
  {
    JsonNode resultIds = result.path("data").path("resultIds");
    if (resultIds.isNull() ||
        resultIds.isMissingNode() ||
        resultIds.asText().isEmpty())
    {
      return Collections.emptyList();
    }
    return new ArrayList<>(Arrays.asList(resultIds.asText().split(",")));
  }
771531
public java.util.List<String> getResults() {
        if (results == null) {
            results = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return results;
    }
937205
public @Nonnull Result combine(@Nonnull Result that) {
        if(this.ordinal < that.ordinal)
            return that;
        else
            return this;
    }
928897
public String resultToReplayUrl(CaptureSearchResult result) {
		if(uriConverter == null) {
			return null;
		}
		String url = result.getOriginalUrl();
		String captureDate = result.getCaptureTimestamp();
		return uriConverter.makeReplayURI(captureDate,url);
	}
807942
protected String getExName(Map result) {

        String ret = getValueOr(result, "exname", "");
        if (ret.matches("\\w+\\.\\w{2}[Xx]")) {
            ret = ret.substring(0, ret.length() - 1).replace(".", "");
        }
        // TODO need to be updated with a translate rule for other models' exname
        if (ret.matches(".+(_+\\d+)+$")) {
            ret = ret.replaceAll("(_+\\d+)+$", "");
        }

        return ret;
    }
1054578
static final String extractNameType(final String outcome) {
    final Matcher matcher = typedOutcomePattern.matcher(outcome);
    if (matcher.matches()) {
      final String nameType = matcher.group(1);
      return nameType;
    }

    return null;
  }
623760
public ExecutionResult withResult(Object result) {
    return new ExecutionResult(result, null, nonResult, waitNanos, true, true, successAll);
  }
371162
private List<String> formatResult(Result result, Server server) {
		List<String> resultStrings = new LinkedList<>();

		if (result.getValuePath().isEmpty()) {
			processOneMetric(resultStrings, server, result, result.getValue(), null, null);
		} else {
			processOneMetric(resultStrings, server, result, result.getValue(), tagName, StringUtils.join(result.getValuePath(), '.'));
		}
		return resultStrings;
	}
938471
private void returnResults() {
    final StringBuilder sb = new StringBuilder();
    for (final String result : this.results) {
      sb.append(result);
    }
    this.results.clear();
    LOG.log(Level.INFO, "Return results to the client:\n{0}", sb);
    httpCallbackHandler.onNext(CODEC.encode(sb.toString()));
  }
1149416
private String getMapResultString(Map result) {
        StringBuilder sb = new StringBuilder();
        Iterator<Entry> i = result.entrySet().iterator();
        if (!i.hasNext()) {
            return "{}";
        }
        sb.append('{');
        for (;;) {
            Entry e = i.next();
            Object key = e.getKey();
            Object value = e.getValue();
            // 注意: 修改为getResultString(e)进行递归处理
            sb.append(key == this ? "(this Map)" : getResultString(key));
            sb.append('=');
            // 注意: 修改为getResultString(e)进行递归处理
            sb.append(value == this ? "(this Map)" : getResultString(value));
            if (!i.hasNext()) {
                return sb.append('}').toString();
            }
            sb.append(", ");
        }
    }