All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alibaba.cola.statemachine.impl.StateHelper Maven / Gradle / Ivy

package com.alibaba.cola.statemachine.impl;

import com.alibaba.cola.statemachine.State;

import java.util.Map;

/**
 * StateHelper
 *
 * @author Frank Zhang
 * @date 2020-02-08 4:23 PM
 */
public class StateHelper {
    public static  State getState(Map> stateMap, S stateId){
        State state = stateMap.get(stateId);
        if (state == null) {
            state = new StateImpl<>(stateId);
            stateMap.put(stateId, state);
        }
        return state;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy