Codota Logo
JSONArray.optString
Code IndexAdd Codota to your IDE (free)

How to use
optString
method
in
org.opencms.json.JSONArray

Best Java code snippets using org.opencms.json.JSONArray.optString (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: org.opencms/opencms-core

/**
 * Get the optional string value associated with an index.<p>
 *
 * It returns an empty string if there is no value at that index. If the value
 * is not a string and is not null, then it is coverted to a string.<p>
 *
 * @param index the index must be between 0 and length() - 1
 * @return a String value
 */
public String optString(int index) {
  return optString(index, "");
}
origin: org.opencms/opencms-solr

/**
 * Get the optional string value associated with an index.<p>
 * 
 * It returns an empty string if there is no value at that index. If the value
 * is not a string and is not null, then it is coverted to a string.<p>
 *
 * @param index the index must be between 0 and length() - 1
 * @return a String value
 */
public String optString(int index) {
  return optString(index, "");
}
origin: org.opencms/opencms-core

/**
 * Converts the given JSON object into a valid parameter map.<p>
 *
 * @param params the JSON object to convert
 *
 * @return the parameter map from the given JSON object
 */
public static Map<String, String[]> getParameterMapFromJSON(JSONObject params) {
  Map<String, String[]> result = new HashMap<String, String[]>();
  Iterator<String> itKeys = params.keys();
  while (itKeys.hasNext()) {
    String key = itKeys.next();
    JSONArray paramValue = params.optJSONArray(key);
    result.put(key, new String[paramValue.length()]);
    for (int i = 0, l = paramValue.length(); i < l; i++) {
      result.get(key)[i] = paramValue.optString(i);
    }
  }
  return result;
}
origin: org.opencms/opencms-core

List<String> formatValueList = new ArrayList<String>(formatValues.length());
for (int i = 0; i < formatValues.length(); i++) {
  formatValueList.add(formatValues.optString(i));
origin: org.opencms/opencms-solr

List formatValueList = new ArrayList(formatValues.length());
for (int i = 0; i < formatValues.length(); i++) {
  formatValueList.add(formatValues.optString(i));
org.opencms.jsonJSONArrayoptString

Javadoc

Get the optional string value associated with an index.

It returns an empty string if there is no value at that index. If the value is not a string and is not null, then it is coverted to a string.

Popular methods of JSONArray

  • <init>
    Construct a JSONArray from a JSONTokener.
  • toString
    Make a pretty printed JSON text of this JSONArray. Warning: This method assumes that the data struct
  • get
    Get the object value associated with an index.
  • getBoolean
    Get the boolean value associated with an index. The string values "true" and "false" are converted t
  • getDouble
    Get the double value associated with an index.
  • getInt
    Get the int value associated with an index.
  • getLong
    Get the long value associated with an index.
  • getString
    Get the string associated with an index.
  • join
    Make a string from the contents of this JSONArray. The separator string is inserted between each ele
  • length
    Get the number of elements in the JSONArray, included nulls.
  • opt
    Get the optional object value associated with an index.
  • optBoolean
    Get the optional boolean value associated with an index. It returns the defaultValue if there is no
  • opt,
  • optBoolean,
  • optDouble,
  • optInt,
  • optJSONObject,
  • optLong,
  • put,
  • toJSONObject,
  • write

Popular in Java

  • Reactive rest calls using spring rest template
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • startActivity (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • Path (java.nio.file)
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • JFileChooser (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now