com.twilio.twiml.voice.SsmlW Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twilio Show documentation
Show all versions of twilio Show documentation
Twilio Java Helper Library
/**
* 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 SsmlW extends TwiML {
private final String role;
private final String words;
/**
* For XML Serialization/Deserialization
*/
private SsmlW() {
this(new Builder((String) null));
}
/**
* Create a new {@code } element
*/
private SsmlW(Builder b) {
super("w", b);
this.role = b.role;
this.words = b.words;
}
/**
* The body of the TwiML element
*
* @return Element body as a string if present else null
*/
protected String getElementBody() {
return this.getWords() == null ? null : this.getWords();
}
/**
* 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.getRole() != null) {
attrs.put("role", this.getRole());
}
return attrs;
}
/**
* Customize the pronunciation of words by specifying the word’s part of speech
* or alternate meaning
*
* @return Customize the pronunciation of words by specifying the word’s part
* of speech or alternate meaning
*/
public String getRole() {
return role;
}
/**
* Words to speak
*
* @return Words to speak
*/
public String getWords() {
return words;
}
/**
* Create a new {@code } element
*/
public static class Builder extends TwiML.Builder {
private String role;
private String words;
/**
* Create a {@code } with words
*/
public Builder(String words) {
this.words = words;
}
/**
* Customize the pronunciation of words by specifying the word’s part of speech
* or alternate meaning
*/
public Builder role(String role) {
this.role = role;
return this;
}
/**
* Create and return resulting {@code } element
*/
public SsmlW build() {
return new SsmlW(this);
}
}
}