class NamedThreadFactory implements ThreadFactory {
    private final String namePrefix;
    private final AtomicInteger threadCount = new AtomicInteger(0);

    private ThreadGroup group;
    private boolean daemon = false;
    private int priority = Thread.NORM_PRIORITY;

    /**
     * @param namePrefix 名字前缀
     */
    public NamedThreadFactory(String namePrefix) {
        if (Utils.isEmpty(namePrefix)) {
            this.namePrefix = this.getClass().getSimpleName() + "-";
        } else {
            this.namePrefix = namePrefix;
        }
    }


    /**
     * 线程组
     */
    public NamedThreadFactory group(ThreadGroup group) {
        this.group = group;
        return this;
    }


    /**
     * 线程守护
     */
    public NamedThreadFactory daemon(boolean daemon) {
        this.daemon = daemon;
        return this;
    }

    /**
     * 优先级
     */
    public NamedThreadFactory priority(int priority) {
        this.priority = priority;
        return this;
    }

    @Override
    public Thread newThread(Runnable r) {<FILL_FUNCTION_BODY>}
}

        Thread t = new Thread(group, r, namePrefix + threadCount.incrementAndGet());
        t.setDaemon(daemon);
        t.setPriority(priority);

        return t;
    
<no_super_class>