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

com.atlan.model.admin.AbstractPersonaPolicy Maven / Gradle / Ivy

// Generated by delombok at Thu Oct 10 18:56:32 UTC 2024
/* SPDX-License-Identifier: Apache-2.0
   Copyright 2022 Atlan Pte. Ltd. */
package com.atlan.model.admin;

import java.util.SortedSet;

public abstract class AbstractPersonaPolicy extends AbstractPolicy {
    private static final long serialVersionUID = 2L;
    /**
     * Unique identifier (GUID) of the connection to which this policy applies.
     */
    String connectionId;
    /**
     * All assets' qualifiedNames to include in the policy.
     * These act as prefixes, so any assets within these will also be included in the
     * policy. (For example, if you give the qualifiedName of a schema, all tables and
     * columns in that schema are also included in the policy.)
     */
    SortedSet assets;


    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public static abstract class AbstractPersonaPolicyBuilder> extends AbstractPolicy.AbstractPolicyBuilder {
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private String connectionId;
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private java.util.ArrayList assets;

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

        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private static void $fillValuesFromInstanceIntoBuilder(final AbstractPersonaPolicy instance, final AbstractPersonaPolicy.AbstractPersonaPolicyBuilder b) {
            b.connectionId(instance.connectionId);
            b.assets(instance.assets == null ? java.util.Collections.emptySortedSet() : instance.assets);
        }

        /**
         * Unique identifier (GUID) of the connection to which this policy applies.
         * @return {@code this}.
         */
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B connectionId(final String connectionId) {
            this.connectionId = connectionId;
            return self();
        }

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

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

        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B clearAssets() {
            if (this.assets != null) this.assets.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 "AbstractPersonaPolicy.AbstractPersonaPolicyBuilder(super=" + super.toString() + ", connectionId=" + this.connectionId + ", assets=" + this.assets + ")";
        }
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    protected AbstractPersonaPolicy(final AbstractPersonaPolicy.AbstractPersonaPolicyBuilder b) {
        super(b);
        this.connectionId = b.connectionId;
        java.util.SortedSet assets = new java.util.TreeSet();
        if (b.assets != null) assets.addAll(b.assets);
        assets = java.util.Collections.unmodifiableSortedSet(assets);
        this.assets = assets;
    }

    /**
     * Unique identifier (GUID) of the connection to which this policy applies.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public String getConnectionId() {
        return this.connectionId;
    }

    /**
     * All assets' qualifiedNames to include in the policy.
     * These act as prefixes, so any assets within these will also be included in the
     * policy. (For example, if you give the qualifiedName of a schema, all tables and
     * columns in that schema are also included in the policy.)
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public SortedSet getAssets() {
        return this.assets;
    }

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

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

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

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public java.lang.String toString() {
        return "AbstractPersonaPolicy(super=" + super.toString() + ", connectionId=" + this.getConnectionId() + ", assets=" + this.getAssets() + ")";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy