
com.github.joekerouac.common.tools.scheduler.TaskDescriptor Maven / Gradle / Ivy
The newest version!
// Generated by delombok at Fri Mar 14 11:41:38 CST 2025
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
* file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
* to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.github.joekerouac.common.tools.scheduler;
/**
* 任务描述
*
* @author JoeKerouac
* @date 2022-10-14 14:37:00
* @since 1.0.0
*/
public class TaskDescriptor {
/**
* 任务ID
*/
private String id;
/**
* 任务执行时间间隔,单位毫秒,执行间隔从上一次执行完成后开始计算;
*/
private long executeInterval;
/**
* 任务执行器
*/
private Runnable task;
/**
* 该任务是否要合并调度,为空表示使用调度器的默认值;
*/
private Boolean mergeScheduler;
public TaskDescriptor(final String id, final long executeInterval, final Runnable task) {
this(id, executeInterval, task, null);
}
/**
* 任务ID
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public String getId() {
return this.id;
}
/**
* 任务执行时间间隔,单位毫秒,执行间隔从上一次执行完成后开始计算;
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public long getExecuteInterval() {
return this.executeInterval;
}
/**
* 任务执行器
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Runnable getTask() {
return this.task;
}
/**
* 该任务是否要合并调度,为空表示使用调度器的默认值;
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public Boolean getMergeScheduler() {
return this.mergeScheduler;
}
/**
* 任务ID
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setId(final String id) {
this.id = id;
}
/**
* 任务执行时间间隔,单位毫秒,执行间隔从上一次执行完成后开始计算;
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setExecuteInterval(final long executeInterval) {
this.executeInterval = executeInterval;
}
/**
* 任务执行器
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setTask(final Runnable task) {
this.task = task;
}
/**
* 该任务是否要合并调度,为空表示使用调度器的默认值;
*/
@java.lang.SuppressWarnings("all")
@lombok.Generated
public void setMergeScheduler(final Boolean mergeScheduler) {
this.mergeScheduler = mergeScheduler;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public boolean equals(final java.lang.Object o) {
if (o == this) return true;
if (!(o instanceof TaskDescriptor)) return false;
final TaskDescriptor other = (TaskDescriptor) o;
if (!other.canEqual((java.lang.Object) this)) return false;
if (this.getExecuteInterval() != other.getExecuteInterval()) return false;
final java.lang.Object this$mergeScheduler = this.getMergeScheduler();
final java.lang.Object other$mergeScheduler = other.getMergeScheduler();
if (this$mergeScheduler == null ? other$mergeScheduler != null : !this$mergeScheduler.equals(other$mergeScheduler)) return false;
final java.lang.Object this$id = this.getId();
final java.lang.Object other$id = other.getId();
if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
final java.lang.Object this$task = this.getTask();
final java.lang.Object other$task = other.getTask();
if (this$task == null ? other$task != null : !this$task.equals(other$task)) return false;
return true;
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
protected boolean canEqual(final java.lang.Object other) {
return other instanceof TaskDescriptor;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public int hashCode() {
final int PRIME = 59;
int result = 1;
final long $executeInterval = this.getExecuteInterval();
result = result * PRIME + (int) ($executeInterval >>> 32 ^ $executeInterval);
final java.lang.Object $mergeScheduler = this.getMergeScheduler();
result = result * PRIME + ($mergeScheduler == null ? 43 : $mergeScheduler.hashCode());
final java.lang.Object $id = this.getId();
result = result * PRIME + ($id == null ? 43 : $id.hashCode());
final java.lang.Object $task = this.getTask();
result = result * PRIME + ($task == null ? 43 : $task.hashCode());
return result;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
@lombok.Generated
public java.lang.String toString() {
return "TaskDescriptor(id=" + this.getId() + ", executeInterval=" + this.getExecuteInterval() + ", task=" + this.getTask() + ", mergeScheduler=" + this.getMergeScheduler() + ")";
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public TaskDescriptor() {
}
@java.lang.SuppressWarnings("all")
@lombok.Generated
public TaskDescriptor(final String id, final long executeInterval, final Runnable task, final Boolean mergeScheduler) {
this.id = id;
this.executeInterval = executeInterval;
this.task = task;
this.mergeScheduler = mergeScheduler;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy