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

com.sinch.sdk.domains.voice.models.svaml.ActionPark 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 ActionPark extends Action {

  private final OptionalValue locale;
  private final OptionalValue introPrompt;
  private final OptionalValue holdPrompt;
  private final OptionalValue maxDuration;

  private ActionPark(
      OptionalValue locale,
      OptionalValue introPrompt,
      OptionalValue holdPrompt,
      OptionalValue maxDuration) {
    this.locale = locale;
    this.introPrompt = introPrompt;
    this.holdPrompt = holdPrompt;
    this.maxDuration = maxDuration;
  }

  public OptionalValue getLocale() {
    return locale;
  }

  public OptionalValue getIntroPrompt() {
    return introPrompt;
  }

  public OptionalValue getHoldPrompt() {
    return holdPrompt;
  }

  public OptionalValue getMaxDuration() {
    return maxDuration;
  }

  @Override
  public String toString() {
    return "ActionPark{"
        + "locale='"
        + locale
        + '\''
        + ", introPrompt='"
        + introPrompt
        + '\''
        + ", holdPrompt='"
        + holdPrompt
        + '\''
        + ", maxDuration="
        + maxDuration
        + "} "
        + super.toString();
  }

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

  public static class Builder> {

    OptionalValue locale = OptionalValue.empty();
    OptionalValue introPrompt = OptionalValue.empty();
    OptionalValue holdPrompt = OptionalValue.empty();
    OptionalValue maxDuration = OptionalValue.empty();

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

    public Builder setIntroPrompt(String introPrompt) {
      this.introPrompt = OptionalValue.of(introPrompt);
      return this;
    }

    public Builder setHoldPrompt(String holdPrompt) {
      this.holdPrompt = OptionalValue.of(holdPrompt);
      return this;
    }

    public Builder setMaxDuration(Integer maxDuration) {
      this.maxDuration = OptionalValue.of(maxDuration);
      return this;
    }

    public ActionPark build() {
      return new ActionPark(locale, introPrompt, holdPrompt, maxDuration);
    }

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