August 2018
Intermediate to advanced
524 pages
14h 45m
English
This class has three public methods:
The code of the class is as follows:
public class GameSessionSaver { private static final String STATE_NAME = "GAME_STATE"; @Inject private HtmlTools html; @Inject Table table; @Inject ColorManager manager; public void save(HttpSession session) { var params = convertTableToMap(); session.setAttribute(STATE_NAME, params); } public void reset(HttpSession session) { session.removeAttribute(STATE_NAME); } public Map<String, String> restore(HttpSession session) { return (Map<String, String>) Optional.ofNullable(session.getAttribute(STATE_NAME)) ...