class PossibleActionsRuleEngine {

    public EnumSet<PossibleActionEnum> getPossibleTokenActions(TokenInfo tokenInfo) {
        EnumSet<PossibleActionEnum> actions = EnumSet.noneOf(PossibleActionEnum.class);

        if (tokenInfo.isActive()) {
            actions.add(PossibleActionEnum.GENERATE_KEY);
        }

        if (tokenInfo.isActive()) {
            actions.add(PossibleActionEnum.TOKEN_DEACTIVATE);
        } else {
            if (tokenInfo.isAvailable()) {
                actions.add(PossibleActionEnum.TOKEN_ACTIVATE);
            }
        }

        if (tokenInfo.isSavedToConfiguration()) {
            actions.add(PossibleActionEnum.EDIT_FRIENDLY_NAME);
        }

        return actions;
    }

}