package com.beck.rn.alipay;import android.text.TextUtils;public class PayResult {	private String resultStatus;	private String result;	private String memo;//	public PayResult(Map<String, String> rawResult) {//		if (rawResult == null) {//			return;//		}////		for (String key : rawResult.keySet()) {//			if (TextUtils.equals(key, "resultStatus")) {//				resultStatus = rawResult.get(key);//			} else if (TextUtils.equals(key, "result")) {//				result = rawResult.get(key);//			} else if (TextUtils.equals(key, "memo")) {//				memo = rawResult.get(key);//			}//		}//	}	public PayResult(String rawResult) {		if (TextUtils.isEmpty(rawResult))			return;		String[] resultParams = rawResult.split("\\};");	//由于result中的返回数据有大机率包含";", 故使用"};"来代替		for (String resultParam : resultParams) {//			Log.i("resultParam = ", resultParam);			if (resultParam.startsWith("resultStatus")) {				resultStatus = getValue(resultParam + "}", "resultStatus");			}			else if (resultParam.startsWith("memo")) {				memo = getValue(resultParam + "}", "memo");			}			else if (resultParam.startsWith("result")) {				result = getValue(resultParam, "result");			}		}	}	@Override	public String toString() {		return "resultStatus={" + resultStatus + "};memo={" + memo				+ "};result={" + result + "}";	}	private String getValue(String content, String key) {		String prefix = key + "={";		return content.substring(content.indexOf(prefix) + prefix.length(),				content.lastIndexOf("}"));	}	/**	 * @return the resultStatus	 */	public String getResultStatus() {		return resultStatus;	}	/**	 * @return the memo	 */	public String getMemo() {		return memo;	}	/**	 * @return the result	 */	public String getResult() {		return result;	}}