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

com.sinch.sdk.domains.voice.models.svaml.InstructionSay Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.sinch.sdk.domains.voice.models.svaml;

import com.sinch.sdk.core.models.OptionalValue;

public class InstructionSay extends Instruction {

  private final OptionalValue text;
  private final OptionalValue locale;

  private InstructionSay(OptionalValue text, OptionalValue locale) {
    this.text = text;
    this.locale = locale;
  }

  public OptionalValue getText() {
    return text;
  }

  public OptionalValue getLocale() {
    return locale;
  }

  @Override
  public String toString() {
    return "InstructionSay{"
        + "text="
        + text
        + ", locale='"
        + locale
        + '\''
        + "} "
        + super.toString();
  }

  public static Builder builder() {
    return new Builder<>();
  }

  public static class Builder> {

    OptionalValue text = OptionalValue.empty();
    OptionalValue locale = OptionalValue.empty();

    public Builder setText(String text) {
      this.text = OptionalValue.of(text);
      return this;
    }

    public Builder setLocale(String locale) {
      this.locale = OptionalValue.of(locale);
      return this;
    }

    public InstructionSay build() {
      return new InstructionSay(text, locale);
    }

    @SuppressWarnings("unchecked")
    protected B self() {
      return (B) this;
    }
  }
}