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

com.twilio.twiml.voice.Pause Maven / Gradle / Ivy

There is a newer version: 10.1.5
Show newest version
/**
 * This code was generated by
 * \ / _    _  _|   _  _
 *  | (_)\/(_)(_|\/| |(/_  v1.0.0
 *       /       /
 */

package com.twilio.twiml.voice;

import com.twilio.twiml.TwiML;

import java.util.HashMap;
import java.util.Map;

/**
 * TwiML wrapper for {@code }
 */
public class Pause extends TwiML {
    private final Integer length;

    /**
     * For XML Serialization/Deserialization
     */
    private Pause() {
        this(new Builder());
    }

    /**
     * Create a new {@code } element
     */
    private Pause(Builder b) {
        super("Pause", b);
        this.length = b.length;
    }

    /**
     * Attributes to set on the generated XML element
     *
     * @return A Map of attribute keys to values
     */
    protected Map getElementAttributes() {
        // Preserve order of attributes
        Map attrs = new HashMap<>();

        if (this.getLength() != null) {
            attrs.put("length", this.getLength().toString());
        }

        return attrs;
    }

    /**
     * Length in seconds to pause
     *
     * @return Length in seconds to pause
     */
    public Integer getLength() {
        return length;
    }

    /**
     * Create a new {@code } element
     */
    public static class Builder extends TwiML.Builder {
        private Integer length;

        /**
         * Length in seconds to pause
         */
        public Builder length(Integer length) {
            this.length = length;
            return this;
        }

        /**
         * Create and return resulting {@code } element
         */
        public Pause build() {
            return new Pause(this);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy