private static Map<State, Set<State>> buildTransitions() { Map<State, Set<State>> res = new EnumMap<>(State.class); res.put(INIT, toSet(STARTING)); res.put(STARTING, toSet(STARTED, STOPPING, STOPPED)); res.put(STARTED, toSet(STOPPING, STOPPED)); res.put(STOPPING, toSet(STOPPED)); res.put(STOPPED, toSet()); return res; }
private static Map<State, Set<State>> buildTransitions() { Map<State, Set<State>> res = new EnumMap<>(State.class); res.put(INIT, toSet(STARTING)); res.put(STARTING, toSet(STARTED, STOPPING, STOPPED)); res.put(STARTED, toSet(STOPPING, STOPPED)); res.put(STOPPING, toSet(STOPPED)); res.put(STOPPED, toSet()); return res; }