/** * @param sensitivity Set the sensitivity level. A value of 1.0 means that * it is highly sensitive to quiet input. A value of 0.0 means it * is least sensitive to noise. <code>null</code> to use the * VoiceXML platform default. */ public void setSensitivity(Double sensitivity) { if (sensitivity != null) { Assert.between(0, sensitivity, 1.0); } mSensitivity = sensitivity; }
/** * @param speechRecognition The speech recognition configuration. * @param dtmfRecognition The DTMF recognition configuration. * @param audioItems The list of {@link AudioItem}. Not null. */ public Prompt(SpeechRecognition speechRecognition, DtmfRecognition dtmfRecognition, AudioItem... audioItems) { this(speechRecognition, dtmfRecognition, asListChecked(audioItems)); }
/** * Adds a property to the enclosing form * * @param propertyName The name of the property. Not empty. * @param propertyValue The value of the property. Not null. * @see <a * href="https://www.w3.org/TR/voicexml20/#dml6.3">https://www.w3.org/TR/voicexml20/#dml6.3</a> */ public void addProperty(String propertyName, String propertyValue) { Assert.notEmpty(propertyName, "propertyName"); Assert.notNull(propertyValue, "propertyValue"); mProperties.put(propertyName, propertyValue); }
/** * @param submitParameters A list of variable to submit when invoking the * URI. Not null. */ public final void setSubmitParameters(VariableList submitParameters) { Assert.notNull(submitParameters, "submitParameters"); mSubmitParameters = submitParameters; }
private void assertInvariant() { Assert.ensure(mSpeechRecognition != null || mDtmfRecognition != null, "Must provide a non-null configuration for speech or DTMF"); }
/** * @param text The synthesis text. Not empty. */ public SpeechSynthesis(String text) { Assert.notEmpty(text, "text"); mText = text; mDocumentFragment = null; }
/** * @param parameters A list of {@link Parameter} that will be passed to the * subdialogue. Not null. */ public final void setSubdialogueParameters(Collection<Parameter> parameters) { Assert.noNullValues(parameters, "parameters"); mParameters = new ArrayList<Parameter>(parameters); }
/** * @param maxNBest The maximum size of the recognition result. Must be a * positive integer. <code>null</code> to use the VoiceXML * platform default * @see <a * href="https://www.w3.org/TR/voicexml20/#dml6.3.2">https://www.w3.org/TR/voicexml20/#dml6.3.2</a> */ public void setMaxNBest(Integer maxNBest) { if (maxNBest != null) { Assert.positive(maxNBest, "maxNBest"); } mMaxNBest = maxNBest; }
public static Duration milliseconds(long milliseconds) { Assert.notNegative(milliseconds, "milliseconds"); return new Duration(milliseconds); }
/** * Sets maximum duration the servlet thread can wait for the dialogue * response. * * @param dialogueTimeout the timeout. Cannot be <code>null</code>. A value * of <code>Duration.ZERO</code> (or equivalent) means to wait * forever. */ public final void setDialogueTimeout(Duration dialogueTimeout) { Assert.notNull(dialogueTimeout, "dialogueTimeout"); mDialogueTimeout = dialogueTimeout; }
/** * @param name The name of the parameter. Not empty. * @param value The string value of the parameter. Not null. * @return The newly created object parameter */ public static Parameter createWithValue(String name, String value) { Assert.notEmpty(name, "name"); Assert.notNull(value, "value"); Parameter parameter = new Parameter(name); parameter.mValue = value; return parameter; }
public static void positive(long value, String symbol) { ensure(value > 0, symbol + " should be positive. Value=" + value); }
public Builder uri(String uri) { Assert.notEmpty(uri, "uri"); mUri = uri; return this; }
/** * Add some audio items. * * @param audioItems the audio items to add * @return this builder */ public Builder addAudioItems(List<AudioItem> audioItems) { Assert.noNullValues(audioItems, mLanguage); mAudioItems.addAll(audioItems); return this; }
public Disconnect(String name, VariableList variables) { super(name); Assert.notNull(variables, VARIABLES_PROPERTY); mVariables = variables; }
/** * @param name The name of the parameter. Not empty. * @param expression The ECMAScript expression of the parameter. Not * null. * @return The newly created object parameter */ public static Parameter createWithExpression(String name, String expression) { Assert.notEmpty(name, "name"); Assert.notNull(expression, "expression"); Parameter parameter = new Parameter(name); parameter.mExpression = expression; return parameter; }
/** * @param confidenceLevel The speech recognition confidence level. Results * with confidence below this value will be rejected (nomatch). * Value must be between 0.0 and 1.0.<code>null</code> to use the * VoiceXML platform default. * @see <a * href="https://www.w3.org/TR/voicexml20/#dml6.3.2">https://www.w3.org/TR/voicexml20/#dml6.3.2</a> */ public void setConfidenceLevel(Double confidenceLevel) { if (confidenceLevel != null) { Assert.between(0, confidenceLevel, 1.0); } mConfidenceLevel = confidenceLevel; }
public static void notNegative(long value, String symbol) { ensure(value >= 0, symbol + " should not be negative. Value=" + value); }