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

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

There is a newer version: 3.0.0
Show newest version
// Generated by delombok at Thu Oct 10 18:56:32 UTC 2024
/* SPDX-License-Identifier: Apache-2.0
   Copyright 2023 Atlan Pte. Ltd. */
package com.atlan.model.workflow;

import com.atlan.model.core.AtlanObject;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.List;
import lombok.*;

@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = PlaybookRule.PlaybookRuleBuilderImpl.class)
public class PlaybookRule extends AtlanObject {
    private static final long serialVersionUID = 2L;
    /**
     * Human-readable name of the rule.
     */
    String name;
    /**
     * Type of rule.
     */
    String type;
    /**
     * Configuration of the search filter for the rule.
     */
    PlaybookRuleConfig config;
    /**
     * UI-based form of the search filter for the rule.
     */
    @JsonIgnore
    Object filterSchema;
    /**
     * Actions to apply to the matching assets.
     */
    List actions;
    /**
     * UI-based form of the actions to apply on the matching assets.
     */
    @JsonIgnore
    Object actionsUISchema;

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    private static String $default$type() {
        return "atlan-indexsearch";
    }


    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public static abstract class PlaybookRuleBuilder> extends AtlanObject.AtlanObjectBuilder {
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private String name;
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private boolean type$set;
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private String type$value;
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private PlaybookRuleConfig config;
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private Object filterSchema;
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private java.util.ArrayList actions;
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private Object actionsUISchema;

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

        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private static void $fillValuesFromInstanceIntoBuilder(final PlaybookRule instance, final PlaybookRule.PlaybookRuleBuilder b) {
            b.name(instance.name);
            b.type(instance.type);
            b.config(instance.config);
            b.filterSchema(instance.filterSchema);
            b.actions(instance.actions == null ? java.util.Collections.emptyList() : instance.actions);
            b.actionsUISchema(instance.actionsUISchema);
        }

        /**
         * Human-readable name of the rule.
         * @return {@code this}.
         */
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B name(final String name) {
            this.name = name;
            return self();
        }

        /**
         * Type of rule.
         * @return {@code this}.
         */
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B type(final String type) {
            this.type$value = type;
            type$set = true;
            return self();
        }

        /**
         * Configuration of the search filter for the rule.
         * @return {@code this}.
         */
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B config(final PlaybookRuleConfig config) {
            this.config = config;
            return self();
        }

        /**
         * UI-based form of the search filter for the rule.
         * @return {@code this}.
         */
        @JsonIgnore
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B filterSchema(final Object filterSchema) {
            this.filterSchema = filterSchema;
            return self();
        }

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

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

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

        /**
         * UI-based form of the actions to apply on the matching assets.
         * @return {@code this}.
         */
        @JsonIgnore
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B actionsUISchema(final Object actionsUISchema) {
            this.actionsUISchema = actionsUISchema;
            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 "PlaybookRule.PlaybookRuleBuilder(super=" + super.toString() + ", name=" + this.name + ", type$value=" + this.type$value + ", config=" + this.config + ", filterSchema=" + this.filterSchema + ", actions=" + this.actions + ", actionsUISchema=" + this.actionsUISchema + ")";
        }
    }


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

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

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

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    protected PlaybookRule(final PlaybookRule.PlaybookRuleBuilder b) {
        super(b);
        this.name = b.name;
        if (b.type$set) this.type = b.type$value;
         else this.type = PlaybookRule.$default$type();
        this.config = b.config;
        this.filterSchema = b.filterSchema;
        java.util.List actions;
        switch (b.actions == null ? 0 : b.actions.size()) {
        case 0: 
            actions = java.util.Collections.emptyList();
            break;
        case 1: 
            actions = java.util.Collections.singletonList(b.actions.get(0));
            break;
        default: 
            actions = java.util.Collections.unmodifiableList(new java.util.ArrayList(b.actions));
        }
        this.actions = actions;
        this.actionsUISchema = b.actionsUISchema;
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public static PlaybookRule.PlaybookRuleBuilder builder() {
        return new PlaybookRule.PlaybookRuleBuilderImpl();
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public PlaybookRule.PlaybookRuleBuilder toBuilder() {
        return new PlaybookRule.PlaybookRuleBuilderImpl().$fillValuesFrom(this);
    }

    /**
     * Human-readable name of the rule.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public String getName() {
        return this.name;
    }

    /**
     * Type of rule.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public String getType() {
        return this.type;
    }

    /**
     * Configuration of the search filter for the rule.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public PlaybookRuleConfig getConfig() {
        return this.config;
    }

    /**
     * UI-based form of the search filter for the rule.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public Object getFilterSchema() {
        return this.filterSchema;
    }

    /**
     * Actions to apply to the matching assets.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public List getActions() {
        return this.actions;
    }

    /**
     * UI-based form of the actions to apply on the matching assets.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public Object getActionsUISchema() {
        return this.actionsUISchema;
    }

    @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 PlaybookRule)) return false;
        final PlaybookRule other = (PlaybookRule) o;
        if (!other.canEqual((java.lang.Object) this)) return false;
        if (!super.equals(o)) return false;
        final java.lang.Object this$name = this.getName();
        final java.lang.Object other$name = other.getName();
        if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false;
        final java.lang.Object this$type = this.getType();
        final java.lang.Object other$type = other.getType();
        if (this$type == null ? other$type != null : !this$type.equals(other$type)) return false;
        final java.lang.Object this$config = this.getConfig();
        final java.lang.Object other$config = other.getConfig();
        if (this$config == null ? other$config != null : !this$config.equals(other$config)) return false;
        final java.lang.Object this$filterSchema = this.getFilterSchema();
        final java.lang.Object other$filterSchema = other.getFilterSchema();
        if (this$filterSchema == null ? other$filterSchema != null : !this$filterSchema.equals(other$filterSchema)) return false;
        final java.lang.Object this$actions = this.getActions();
        final java.lang.Object other$actions = other.getActions();
        if (this$actions == null ? other$actions != null : !this$actions.equals(other$actions)) return false;
        final java.lang.Object this$actionsUISchema = this.getActionsUISchema();
        final java.lang.Object other$actionsUISchema = other.getActionsUISchema();
        if (this$actionsUISchema == null ? other$actionsUISchema != null : !this$actionsUISchema.equals(other$actionsUISchema)) return false;
        return true;
    }

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

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int hashCode() {
        final int PRIME = 59;
        int result = super.hashCode();
        final java.lang.Object $name = this.getName();
        result = result * PRIME + ($name == null ? 43 : $name.hashCode());
        final java.lang.Object $type = this.getType();
        result = result * PRIME + ($type == null ? 43 : $type.hashCode());
        final java.lang.Object $config = this.getConfig();
        result = result * PRIME + ($config == null ? 43 : $config.hashCode());
        final java.lang.Object $filterSchema = this.getFilterSchema();
        result = result * PRIME + ($filterSchema == null ? 43 : $filterSchema.hashCode());
        final java.lang.Object $actions = this.getActions();
        result = result * PRIME + ($actions == null ? 43 : $actions.hashCode());
        final java.lang.Object $actionsUISchema = this.getActionsUISchema();
        result = result * PRIME + ($actionsUISchema == null ? 43 : $actionsUISchema.hashCode());
        return result;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public java.lang.String toString() {
        return "PlaybookRule(super=" + super.toString() + ", name=" + this.getName() + ", type=" + this.getType() + ", config=" + this.getConfig() + ", filterSchema=" + this.getFilterSchema() + ", actions=" + this.getActions() + ", actionsUISchema=" + this.getActionsUISchema() + ")";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy