com.transferwise.tasks.domain.Task Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tw-tasks-core Show documentation
Show all versions of tw-tasks-core Show documentation
Transferwise Tasks Executor - Fire and forget until Alert.
package com.transferwise.tasks.domain;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.UUID;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
public class Task implements ITask {
private UUID id;
private String type;
private String subType;
@SuppressFBWarnings("EI_EXPOSE_REP")
private byte[] data;
private String status;
private long version;
private long processingTriesCount;
private int priority;
// TODO: We should create an interface instead.
public BaseTask toBaseTask() {
return new BaseTask().setId(getId()).setPriority(getPriority()).setType(getType()).setVersion(getVersion());
}
@Override
public ITaskVersionId getVersionId() {
return new TaskVersionId(id, version);
}
}