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

com.hashicorp.cdktf.TerraformResourceLifecycle Maven / Gradle / Ivy

There is a newer version: 0.21.0-pre.141
Show newest version
package com.hashicorp.cdktf;

/**
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.17.1 (build 2bac5fd)", date = "2021-02-18T13:56:39.668Z")
@software.amazon.jsii.Jsii(module = com.hashicorp.cdktf.$Module.class, fqn = "cdktf.TerraformResourceLifecycle")
@software.amazon.jsii.Jsii.Proxy(TerraformResourceLifecycle.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface TerraformResourceLifecycle extends software.amazon.jsii.JsiiSerializable {

    /**
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    default @org.jetbrains.annotations.Nullable java.lang.Boolean getCreateBeforeDestroy() {
        return null;
    }

    /**
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    default @org.jetbrains.annotations.Nullable java.util.List getIgnoreChanges() {
        return null;
    }

    /**
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    default @org.jetbrains.annotations.Nullable java.lang.Boolean getPreventDestroy() {
        return null;
    }

    /**
     * @return a {@link Builder} of {@link TerraformResourceLifecycle}
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    static Builder builder() {
        return new Builder();
    }
    /**
     * A builder for {@link TerraformResourceLifecycle}
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    public static final class Builder implements software.amazon.jsii.Builder {
        private java.lang.Boolean createBeforeDestroy;
        private java.util.List ignoreChanges;
        private java.lang.Boolean preventDestroy;

        /**
         * Sets the value of {@link TerraformResourceLifecycle#getCreateBeforeDestroy}
         * @param createBeforeDestroy the value to be set.
         * @return {@code this}
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
        public Builder createBeforeDestroy(java.lang.Boolean createBeforeDestroy) {
            this.createBeforeDestroy = createBeforeDestroy;
            return this;
        }

        /**
         * Sets the value of {@link TerraformResourceLifecycle#getIgnoreChanges}
         * @param ignoreChanges the value to be set.
         * @return {@code this}
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
        public Builder ignoreChanges(java.util.List ignoreChanges) {
            this.ignoreChanges = ignoreChanges;
            return this;
        }

        /**
         * Sets the value of {@link TerraformResourceLifecycle#getPreventDestroy}
         * @param preventDestroy the value to be set.
         * @return {@code this}
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
        public Builder preventDestroy(java.lang.Boolean preventDestroy) {
            this.preventDestroy = preventDestroy;
            return this;
        }

        /**
         * Builds the configured instance.
         * @return a new instance of {@link TerraformResourceLifecycle}
         * @throws NullPointerException if any required attribute was not provided
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
        @Override
        public TerraformResourceLifecycle build() {
            return new Jsii$Proxy(createBeforeDestroy, ignoreChanges, preventDestroy);
        }
    }

    /**
     * An implementation for {@link TerraformResourceLifecycle}
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    @software.amazon.jsii.Internal
    final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements TerraformResourceLifecycle {
        private final java.lang.Boolean createBeforeDestroy;
        private final java.util.List ignoreChanges;
        private final java.lang.Boolean preventDestroy;

        /**
         * Constructor that initializes the object based on values retrieved from the JsiiObject.
         * @param objRef Reference to the JSII managed object.
         */
        protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
            super(objRef);
            this.createBeforeDestroy = software.amazon.jsii.Kernel.get(this, "createBeforeDestroy", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
            this.ignoreChanges = software.amazon.jsii.Kernel.get(this, "ignoreChanges", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
            this.preventDestroy = software.amazon.jsii.Kernel.get(this, "preventDestroy", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
        }

        /**
         * Constructor that initializes the object based on literal property values passed by the {@link Builder}.
         */
        protected Jsii$Proxy(final java.lang.Boolean createBeforeDestroy, final java.util.List ignoreChanges, final java.lang.Boolean preventDestroy) {
            super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
            this.createBeforeDestroy = createBeforeDestroy;
            this.ignoreChanges = ignoreChanges;
            this.preventDestroy = preventDestroy;
        }

        @Override
        public final java.lang.Boolean getCreateBeforeDestroy() {
            return this.createBeforeDestroy;
        }

        @Override
        public final java.util.List getIgnoreChanges() {
            return this.ignoreChanges;
        }

        @Override
        public final java.lang.Boolean getPreventDestroy() {
            return this.preventDestroy;
        }

        @Override
        @software.amazon.jsii.Internal
        public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
            final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
            final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();

            if (this.getCreateBeforeDestroy() != null) {
                data.set("createBeforeDestroy", om.valueToTree(this.getCreateBeforeDestroy()));
            }
            if (this.getIgnoreChanges() != null) {
                data.set("ignoreChanges", om.valueToTree(this.getIgnoreChanges()));
            }
            if (this.getPreventDestroy() != null) {
                data.set("preventDestroy", om.valueToTree(this.getPreventDestroy()));
            }

            final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
            struct.set("fqn", om.valueToTree("cdktf.TerraformResourceLifecycle"));
            struct.set("data", data);

            final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
            obj.set("$jsii.struct", struct);

            return obj;
        }

        @Override
        public final boolean equals(final Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            TerraformResourceLifecycle.Jsii$Proxy that = (TerraformResourceLifecycle.Jsii$Proxy) o;

            if (this.createBeforeDestroy != null ? !this.createBeforeDestroy.equals(that.createBeforeDestroy) : that.createBeforeDestroy != null) return false;
            if (this.ignoreChanges != null ? !this.ignoreChanges.equals(that.ignoreChanges) : that.ignoreChanges != null) return false;
            return this.preventDestroy != null ? this.preventDestroy.equals(that.preventDestroy) : that.preventDestroy == null;
        }

        @Override
        public final int hashCode() {
            int result = this.createBeforeDestroy != null ? this.createBeforeDestroy.hashCode() : 0;
            result = 31 * result + (this.ignoreChanges != null ? this.ignoreChanges.hashCode() : 0);
            result = 31 * result + (this.preventDestroy != null ? this.preventDestroy.hashCode() : 0);
            return result;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy