package cn.wise.sc.energy.power.plant.business.task.schedule;

import cn.hutool.core.collection.CollectionUtil;

public abstract class ScheduleTask implements Runnable {
    private String id;

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public ScheduleTask(String id) {
        this.id = id;
    }

    @Override
    public abstract void run();

    public static boolean IS_CONTAINS(String compareWords, String... args) {
        if (args.length == 0) {
            return false;
        }
        //map reduce 判断是否包含给定的列表
        return CollectionUtil.toList(args).stream().map(item -> compareWords.contains(item)).reduce((ei, ej) -> ei || ej).get();    }
}