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

com.atlan.model.structs.AuthPolicyCondition Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.List;
import javax.annotation.processing.Generated;
import lombok.*;

/**
 * Policy condition schedule struct
 */
@Generated("com.atlan.generators.ModelGeneratorV2")
@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = AuthPolicyCondition.AuthPolicyConditionBuilderImpl.class)
public class AuthPolicyCondition extends AtlanStruct {
    private static final long serialVersionUID = 2L;
    public static final String TYPE_NAME = "AuthPolicyCondition";
    /**
     * Fixed typeName for AuthPolicyCondition.
     */
    @JsonIgnore
    String typeName;
    /**
     * TBC
     */
    String policyConditionType;
    /**
     * TBC
     */
    List policyConditionValues;

    /**
     * Quickly create a new AuthPolicyCondition.
     * @param policyConditionType TBC
     * @param policyConditionValues TBC
     * @return a AuthPolicyCondition with the provided information
     */
    public static AuthPolicyCondition of(String policyConditionType, List policyConditionValues) {
        return AuthPolicyCondition.builder().policyConditionType(policyConditionType).policyConditionValues(policyConditionValues).build();
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    private static String $default$typeName() {
        return TYPE_NAME;
    }


    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public static abstract class AuthPolicyConditionBuilder> extends AtlanStruct.AtlanStructBuilder {
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private boolean typeName$set;
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private String typeName$value;
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private String policyConditionType;
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private java.util.ArrayList policyConditionValues;

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

        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private static void $fillValuesFromInstanceIntoBuilder(final AuthPolicyCondition instance, final AuthPolicyCondition.AuthPolicyConditionBuilder b) {
            b.typeName(instance.typeName);
            b.policyConditionType(instance.policyConditionType);
            b.policyConditionValues(instance.policyConditionValues == null ? java.util.Collections.emptyList() : instance.policyConditionValues);
        }

        /**
         * Fixed typeName for AuthPolicyCondition.
         * @return {@code this}.
         */
        @JsonIgnore
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B typeName(final String typeName) {
            this.typeName$value = typeName;
            typeName$set = true;
            return self();
        }

        /**
         * TBC
         * @return {@code this}.
         */
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B policyConditionType(final String policyConditionType) {
            this.policyConditionType = policyConditionType;
            return self();
        }

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

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

        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B clearPolicyConditionValues() {
            if (this.policyConditionValues != null) this.policyConditionValues.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 "AuthPolicyCondition.AuthPolicyConditionBuilder(super=" + super.toString() + ", typeName$value=" + this.typeName$value + ", policyConditionType=" + this.policyConditionType + ", policyConditionValues=" + this.policyConditionValues + ")";
        }
    }


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

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

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

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    protected AuthPolicyCondition(final AuthPolicyCondition.AuthPolicyConditionBuilder b) {
        super(b);
        if (b.typeName$set) this.typeName = b.typeName$value;
         else this.typeName = AuthPolicyCondition.$default$typeName();
        this.policyConditionType = b.policyConditionType;
        java.util.List policyConditionValues;
        switch (b.policyConditionValues == null ? 0 : b.policyConditionValues.size()) {
        case 0: 
            policyConditionValues = java.util.Collections.emptyList();
            break;
        case 1: 
            policyConditionValues = java.util.Collections.singletonList(b.policyConditionValues.get(0));
            break;
        default: 
            policyConditionValues = java.util.Collections.unmodifiableList(new java.util.ArrayList(b.policyConditionValues));
        }
        this.policyConditionValues = policyConditionValues;
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public static AuthPolicyCondition.AuthPolicyConditionBuilder builder() {
        return new AuthPolicyCondition.AuthPolicyConditionBuilderImpl();
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public AuthPolicyCondition.AuthPolicyConditionBuilder toBuilder() {
        return new AuthPolicyCondition.AuthPolicyConditionBuilderImpl().$fillValuesFrom(this);
    }

    /**
     * TBC
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public String getPolicyConditionType() {
        return this.policyConditionType;
    }

    /**
     * TBC
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public List getPolicyConditionValues() {
        return this.policyConditionValues;
    }

    @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 AuthPolicyCondition)) return false;
        final AuthPolicyCondition other = (AuthPolicyCondition) o;
        if (!other.canEqual((java.lang.Object) this)) return false;
        if (!super.equals(o)) return false;
        final java.lang.Object this$typeName = this.getTypeName();
        final java.lang.Object other$typeName = other.getTypeName();
        if (this$typeName == null ? other$typeName != null : !this$typeName.equals(other$typeName)) return false;
        final java.lang.Object this$policyConditionType = this.getPolicyConditionType();
        final java.lang.Object other$policyConditionType = other.getPolicyConditionType();
        if (this$policyConditionType == null ? other$policyConditionType != null : !this$policyConditionType.equals(other$policyConditionType)) return false;
        final java.lang.Object this$policyConditionValues = this.getPolicyConditionValues();
        final java.lang.Object other$policyConditionValues = other.getPolicyConditionValues();
        if (this$policyConditionValues == null ? other$policyConditionValues != null : !this$policyConditionValues.equals(other$policyConditionValues)) return false;
        return true;
    }

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

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

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public java.lang.String toString() {
        return "AuthPolicyCondition(super=" + super.toString() + ", typeName=" + this.getTypeName() + ", policyConditionType=" + this.getPolicyConditionType() + ", policyConditionValues=" + this.getPolicyConditionValues() + ")";
    }

    /**
     * Fixed typeName for AuthPolicyCondition.
     */
    @Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public String getTypeName() {
        return this.typeName;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy