MapControll.getInstance().success().add("data",student).getMap();
想问下这句话什么意思,涉及到的语法知识最好帮我解释下,感谢!
5条回答 默认 最新
- 漠上刀栈 2021-09-01 02:32关注
import java.util.HashMap; import java.util.Map; public class MapControll extends HashMap { private static final String STATUS_OK = "isOk"; private static final String STATUS_FAIL = "isFail"; public MapControll() {} public static MapControll getInstance() { return new MapControll(); } public MapControll success() { return this.setSucess(); } public MapControll setSucess() { super.put(STATUS_OK, Boolean.TRUE); return this; } public MapControll add(Object key, Object value) { super.put(key, value); return this; } public Map getMap() { return this; } public static void main(String[] args) { System.err.println(":" + MapControll.getInstance().success().add("data", "data").getMap()); } }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报