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

com.urbanairship.api.createandsend.model.notification.email.VariableDetail Maven / Gradle / Ivy

There is a newer version: 9.3.0
Show newest version
package com.urbanairship.api.createandsend.model.notification.email;

import com.google.common.base.Optional;

/**
 * Represents the variable detail in the create and send notification.
 */
public class VariableDetail {
    private final Optional key;
    private final Optional defaultValue;

    private VariableDetail(Builder builder) {
        key = Optional.fromNullable(builder.key);
        defaultValue = Optional.fromNullable(builder.defaultValue);
    }

    /**
     * VariableDetail Builder
     * @return Builder
     */
    public static Builder newBuilder() {
        return new Builder();
    }

    /**
     * Get the variable you want to add to the template.
     * @return Optional String
     */
    public Optional getKey() {
        return key;
    }

    /**
     * Get the default value for the variable.
     * @return Optional String
     */
    public Optional getDefaultValue() {
        return defaultValue;
    }

    public static class Builder {
        private String key;
        private String defaultValue;

        /**
         * Set the variable you want to add to the template.
         * @param key String
         * @return VariableDetail Builder
         */
        public Builder setKey(String key) {
            this.key = key;
            return this;
        }

        /**
         * Set the default value for the variable.
         * @param defaultValue String
         * @return VariableDetail Builder
         */
        public Builder setDefaultValue(String defaultValue) {
            this.defaultValue = defaultValue;
            return this;
        }

        public VariableDetail build() {
            return new VariableDetail(this);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy