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

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

There is a newer version: 4.2.1
Show newest version
// Generated by delombok at Tue Nov 26 17:04:58 UTC 2024
/* SPDX-License-Identifier: Apache-2.0
   Copyright 2022 Atlan Pte. Ltd. */
package com.atlan.model.workflow;

import com.atlan.model.core.AtlanObject;

/**
 * Definition of arbitrary name-value pairs.
 */
@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = NameValuePair.NameValuePairBuilderImpl.class)
public class NameValuePair extends AtlanObject {
    private static final long serialVersionUID = 2L;
    /**
     * Name or key of the pair.
     */
    String name;
    /**
     * Value for the pair.
     */
    Object value;

    /**
     * Build a NameValuePair from the provided name and value.
     *
     * @param name for the pair
     * @param value for the name
     * @return the NameValuePair
     */
    public static NameValuePair of(String name, String value) {
        return NameValuePair.builder().name(name).value(value).build();
    }

    /**
     * Build a NameValuePair from the provided name and value.
     *
     * @param name for the pair
     * @param value for the name
     * @return the NameValuePair
     */
    public static NameValuePair of(String name, boolean value) {
        return NameValuePair.builder().name(name).value(value).build();
    }


    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public static abstract class NameValuePairBuilder> extends AtlanObject.AtlanObjectBuilder {
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private String name;
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private Object value;

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

        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        private static void $fillValuesFromInstanceIntoBuilder(final NameValuePair instance, final NameValuePair.NameValuePairBuilder b) {
            b.name(instance.name);
            b.value(instance.value);
        }

        /**
         * Name or key of the pair.
         * @return {@code this}.
         */
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B name(final String name) {
            this.name = name;
            return self();
        }

        /**
         * Value for the pair.
         * @return {@code this}.
         */
        @java.lang.SuppressWarnings("all")
        @lombok.Generated
        public B value(final Object value) {
            this.value = value;
            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 "NameValuePair.NameValuePairBuilder(super=" + super.toString() + ", name=" + this.name + ", value=" + this.value + ")";
        }
    }


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

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

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

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    protected NameValuePair(final NameValuePair.NameValuePairBuilder b) {
        super(b);
        this.name = b.name;
        this.value = b.value;
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public static NameValuePair.NameValuePairBuilder builder() {
        return new NameValuePair.NameValuePairBuilderImpl();
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public NameValuePair.NameValuePairBuilder toBuilder() {
        return new NameValuePair.NameValuePairBuilderImpl().$fillValuesFrom(this);
    }

    /**
     * Name or key of the pair.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public String getName() {
        return this.name;
    }

    /**
     * Value for the pair.
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public Object getValue() {
        return this.value;
    }

    @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 NameValuePair)) return false;
        final NameValuePair other = (NameValuePair) 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$value = this.getValue();
        final java.lang.Object other$value = other.getValue();
        if (this$value == null ? other$value != null : !this$value.equals(other$value)) return false;
        return true;
    }

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

    @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 $value = this.getValue();
        result = result * PRIME + ($value == null ? 43 : $value.hashCode());
        return result;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public java.lang.String toString() {
        return "NameValuePair(super=" + super.toString() + ", name=" + this.getName() + ", value=" + this.getValue() + ")";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy