All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.atlan.model.workflow.WorkflowDAG Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
// Generated by delombok at Wed Oct 16 22:16:02 UTC 2024
/* SPDX-License-Identifier: Apache-2.0
   Copyright 2022 Atlan Pte. Ltd. */
package com.atlan.model.workflow;

import com.atlan.model.core.AtlanObject;
import java.util.List;

/**
 * Definition of the tasks within a workflow step.
 */
@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = WorkflowDAG.WorkflowDAGBuilderImpl.class)
public class WorkflowDAG extends AtlanObject {
    private static final long serialVersionUID = 2L;
    /**
     * Tasks within this step.
     */
    List tasks;


    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public static abstract class WorkflowDAGBuilder> extends AtlanObject.AtlanObjectBuilder {
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private java.util.ArrayList tasks;

        @java.lang.Override
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        protected B $fillValuesFrom(final C instance) {
            super.$fillValuesFrom(instance);
            WorkflowDAG.WorkflowDAGBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
            return self();
        }

        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private static void $fillValuesFromInstanceIntoBuilder(final WorkflowDAG instance, final WorkflowDAG.WorkflowDAGBuilder b) {
            b.tasks(instance.tasks == null ? java.util.Collections.emptyList() : instance.tasks);
        }

        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B task(final WorkflowTask task) {
            if (this.tasks == null) this.tasks = new java.util.ArrayList();
            this.tasks.add(task);
            return self();
        }

        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B tasks(final java.util.Collection tasks) {
            if (tasks == null) {
                throw new java.lang.NullPointerException("tasks cannot be null");
            }
            if (this.tasks == null) this.tasks = new java.util.ArrayList();
            this.tasks.addAll(tasks);
            return self();
        }

        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B clearTasks() {
            if (this.tasks != null) this.tasks.clear();
            return self();
        }

        @java.lang.Override
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        protected abstract B self();

        @java.lang.Override
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public abstract C build();

        @java.lang.Override
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public java.lang.String toString() {
            return "WorkflowDAG.WorkflowDAGBuilder(super=" + super.toString() + ", tasks=" + this.tasks + ")";
        }
    }


    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "", buildMethodName = "build")
    static final class WorkflowDAGBuilderImpl extends WorkflowDAG.WorkflowDAGBuilder {
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private WorkflowDAGBuilderImpl() {
        }

        @java.lang.Override
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        protected WorkflowDAG.WorkflowDAGBuilderImpl self() {
            return this;
        }

        @java.lang.Override
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public WorkflowDAG build() {
            return new WorkflowDAG(this);
        }
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    protected WorkflowDAG(final WorkflowDAG.WorkflowDAGBuilder b) {
        super(b);
        java.util.List tasks;
        switch (b.tasks == null ? 0 : b.tasks.size()) {
        case 0: 
            tasks = java.util.Collections.emptyList();
            break;
        case 1: 
            tasks = java.util.Collections.singletonList(b.tasks.get(0));
            break;
        default: 
            tasks = java.util.Collections.unmodifiableList(new java.util.ArrayList(b.tasks));
        }
        this.tasks = tasks;
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public static WorkflowDAG.WorkflowDAGBuilder builder() {
        return new WorkflowDAG.WorkflowDAGBuilderImpl();
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public WorkflowDAG.WorkflowDAGBuilder toBuilder() {
        return new WorkflowDAG.WorkflowDAGBuilderImpl().$fillValuesFrom(this);
    }

    /**
     * Tasks within this step.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public List getTasks() {
        return this.tasks;
    }

    @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 WorkflowDAG)) return false;
        final WorkflowDAG other = (WorkflowDAG) o;
        if (!other.canEqual((java.lang.Object) this)) return false;
        if (!super.equals(o)) return false;
        final java.lang.Object this$tasks = this.getTasks();
        final java.lang.Object other$tasks = other.getTasks();
        if (this$tasks == null ? other$tasks != null : !this$tasks.equals(other$tasks)) return false;
        return true;
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    protected boolean canEqual(final java.lang.Object other) {
        return other instanceof WorkflowDAG;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int hashCode() {
        final int PRIME = 59;
        int result = super.hashCode();
        final java.lang.Object $tasks = this.getTasks();
        result = result * PRIME + ($tasks == null ? 43 : $tasks.hashCode());
        return result;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public java.lang.String toString() {
        return "WorkflowDAG(super=" + super.toString() + ", tasks=" + this.getTasks() + ")";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy