/** * Sets the maximum duration the controller thread can wait for a turn or an * error from the dialogue thread when not specified by the controller. If * this method is not called, it defaults to 1 minute. * * @param defaultReceiveFromDialogueTimeout The default timeout to use when * not specified by the controller. Cannot be <code>null</code>. */ public void setDefaultReceiveFromDialogueTimeout(Duration defaultReceiveFromDialogueTimeout) { Assert.notNull(defaultReceiveFromDialogueTimeout, "defaultReceiveFromDialogueTimeout"); mDefaultReceiveFromDialogueTimeout = defaultReceiveFromDialogueTimeout; }
/** * Sets the maximum duration the dialogue thread can wait for a turn from * the controller thread when not specified by the dialogue. * * @param defaultReceiveFromControllerTimeout The default timeout to use * when not specified by the dialogue. Cannot be * <code>null</code>. */ public void setDefaultReceiveFromControllerTimeout(Duration defaultReceiveFromControllerTimeout) { Assert.notNull(defaultReceiveFromControllerTimeout, "defaultReceiveFromControllerTimeout"); mDefaultReceiveFromControllerTimeout = defaultReceiveFromControllerTimeout; }
/** * @param source The text source of the grammar. Not null. */ public InlineStringGrammar(String source) { Assert.notNull(source, "source"); mSource = source; }
public Builder setMethod(SubmitMethod method) { Assert.notNull(method, "method"); mMethod = method; return this; }
/** * Sets the logger for this dialogue channel. * * @param logger The logger. Cannot be <code>null</code>. */ public void setLogger(Logger logger) { Assert.notNull(logger, "logger"); mLogger = logger; }
public Submit(String name, String uri, VariableList variables) { super(name); Assert.notNull(uri, "uri"); mVariables = variables; mUri = uri; }
public Return(String name, VariableList variables) { super(name); Assert.notNull(variables, VARIABLES_PROPERTY); mVariables = variables; }
/** * @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; }
/** * 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; }
public Disconnect(String name, VariableList variables) { super(name); Assert.notNull(variables, VARIABLES_PROPERTY); mVariables = variables; }
public Builder addParameter(Parameter parameter) { Assert.notNull(parameter, "parameter"); mParameters.add(parameter); return this; }
public Builder addArchive(String archive) { Assert.notNull(archive, "archive"); mArchives.add(archive); return this; }
public static byte[] toByteArray(InputStream inputStream) throws IOException { Assert.notNull(inputStream, "inputStream"); byte[] buffer = new byte[BUFFER_SIZE]; InputStream bufferedInputStream = new BufferedInputStream(inputStream, BUFFER_SIZE); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); int length = 0; while ((length = bufferedInputStream.read(buffer, 0, BUFFER_SIZE)) != -1) { outputStream.write(buffer, 0, length); } return outputStream.toByteArray(); }
/** * @param name The name of the parameter. Not empty. * @param value The string value of the parameter. Not null. * @return The newly created subdialogue parameter */ public static Parameter createWithValue(String name, String value) { Assert.notNull(value, "value"); Parameter parameter = new Parameter(name); parameter.mValue = value; return parameter; }
/** * @param name The name of the parameter. Not empty. * @param expression The ECMAScript expression of the parameter. Not * null. * @return The newly created subdialogue parameter */ public static Parameter createWithExpression(String name, String expression) { Assert.notNull(expression, "expression"); Parameter parameter = new Parameter(name); parameter.mExpression = expression; return parameter; }
public static void noNullValues(Collection<?> collection, String symbol) { Assert.notNull(collection, symbol); for (Object item : collection) { ensure(item != null, symbol + " should not contain null values."); } }
public static void noNullValues(Object[] array, String symbol) { Assert.notNull(array, symbol); int index = 0; for (Object item : array) { ensure(item != null, symbol + "[" + index + "] should not be null."); index++; } }
public void addWithExpression(String name, String initialExpression) { Assert.notNull(name, "name"); Assert.ensure(VoiceXmlUtils.isValidIdentifierName(name), "Invalid ECMAScript identifier name: '" + name + "'"); mVariables.put(name, initialExpression); }
/** * @param name The name of the parameter. Not empty. * @param json The JSON value of the parameter. Not null. * @return The newly created subdialogue parameter */ public static Parameter createWithJson(String name, JsonValue json) { Assert.notNull(json, "json"); return createWithExpression(name, json.toString()); }
/** * @param name The name of the parameter. Not empty. * @param json The JSON value of the parameter. Not null. * @return The newly created object parameter */ public static Parameter createWithJson(String name, JsonValue json) { Assert.notEmpty(name, "name"); Assert.notNull(json, "json"); return createWithExpression(name, json.toString()); }