congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Assert.ensure
Code IndexAdd Tabnine to your IDE (free)

How to use
ensure
method
in
com.nuecho.rivr.core.util.Assert

Best Java code snippets using com.nuecho.rivr.core.util.Assert.ensure (Showing top 12 results out of 315)

origin: nuecho/rivr

private void assertInvariant() {
  Assert.ensure(mSpeechRecognition != null || mDtmfRecognition != null,
         "Must provide a non-null configuration for speech or DTMF");
}
origin: nuecho/rivr

public static void positive(long value, String symbol) {
  ensure(value > 0, symbol + " should be positive. Value=" + value);
}
origin: nuecho/rivr

public static void notNegative(long value, String symbol) {
  ensure(value >= 0, symbol + " should not be negative. Value=" + value);
}
origin: nuecho/rivr

/**
 * @param termChar The terminating DTMF character for DTMF input
 *            recognition. Must be empty or a single character.
 *            <code>null</code> to use the VoiceXML platform default
 * @see <a
 *      href="https://www.w3.org/TR/voicexml20/#dml6.3.3">https://www.w3.org/TR/voicexml20/#dml6.3.3</a>
 */
public void setTermChar(String termChar) {
  if (termChar != null) {
    Assert.ensure(termChar.equals("") || termChar.length() == 1, "Termchar must be empty or single character");
  }
  mTermChar = termChar;
}
origin: nuecho/rivr

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.");
  }
}
origin: nuecho/rivr

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++;
  }
}
origin: nuecho/rivr

public static void notEmpty(String string, String symbol) {
  notNull(string, symbol);
  ensure(!string.isEmpty(), symbol + " should not be empty.");
}
origin: nuecho/rivr

public static void noNullValues(List<?> list, String symbol) {
  Assert.notNull(list, symbol);
  int index = 0;
  for (Object item : list) {
    ensure(item != null, "item #" + index + " of " + symbol + " should not be null.");
    index++;
  }
}
origin: nuecho/rivr

public static void notEmpty(Collection<?> collection, String symbol) {
  notNull(collection, symbol);
  ensure(!collection.isEmpty(), symbol + " should not be empty.");
}
origin: nuecho/rivr

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);
}
origin: nuecho/rivr

public void addWithString(String name, String string) {
  Assert.notNull(name, "name");
  Assert.ensure(VoiceXmlUtils.isValidIdentifierName(name), "Invalid ECMAScript identifier name: '" + name + "'");
  Assert.notNull(string, "string");
  mVariables.put(name, VoiceXmlDomUtil.createEcmaScriptStringLiteral(string));
}
origin: nuecho/rivr

/**
 * Builds the interaction. This method adds a speech and DTMF
 * recognition window after the prompts.
 *
 * @param speechRecognition configuration for the speech recognition
 * @param dtmfRecognition configuration for the DTMF recognition
 * @param noinputTimeout timeout value before a <code>noinput</code> is
 *            generated.
 * @param acknowledgeAudioItems audioItems to be played upon recognition
 * @return the interaction
 */
public Interaction build(DtmfRecognition dtmfRecognition,
             SpeechRecognition speechRecognition,
             Duration noinputTimeout,
             List<? extends AudioItem> acknowledgeAudioItems) {
  Assert.ensure(dtmfRecognition != null || speechRecognition != null,
         "Must provide at least one recognition configuration (speech or DTMF)");
  checkBuilt();
  FinalRecognitionWindow finalRecognitionWindow = new FinalRecognitionWindow(dtmfRecognition,
                                        speechRecognition,
                                        noinputTimeout);
  if (acknowledgeAudioItems != null) {
    finalRecognitionWindow.setAcknowledgeAudioItems(acknowledgeAudioItems);
  }
  return new Interaction(mName, mPrompts, finalRecognitionWindow);
}
com.nuecho.rivr.core.utilAssertensure

Popular methods of Assert

  • between
  • notNull
  • asListChecked
  • noNullValues
  • notEmpty
  • notNegative
  • positive

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now