You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.3 KiB

/**
* Copyright (C), 2015-2019, XXX有限公司
* FileName: AdvancedLayered
* Author: ye
* Date: 2019/4/17 16:21
* Description:
* History:
* <author> <time> <version> <desc>
* 作者姓名 修改时间 版本号 描述
*/
package com.dsideal.newUniversityExamination.selectcourse.bean;
import com.alibaba.fastjson.JSONObject;
/**
* 〈一句话功能简述〉<br>
* 〈〉
*
* @author ye
* @create 2019/4/17
* @since 1.0.0
*/
public class AdvancedLayered {
JSONObject json;
public AdvancedLayered(){
}
public AdvancedLayered(String jsonStr){
json = JSONObject.parseObject(jsonStr);
}
public String getAdvancedLayeredStr(String param,boolean endIf){
String[] keys = param.split(",");
StringBuffer sb = new StringBuffer("");
sb.append("|");
for(int i=0;i<keys.length;i++){
if(i != 0){
sb.append("^");
}
String key = keys[i];
sb.append(json.get(key));
}
sb.append("_");
if(endIf){
sb.append("|");
}
return sb.toString();
}
// public String getAdvancedLayeredStr(String param){
//
// }
}