Tabnine Logo
JSONArray.isEmpty
Code IndexAdd Tabnine to your IDE (free)

How to use
isEmpty
method
in
org.json.simple.JSONArray

Best Java code snippets using org.json.simple.JSONArray.isEmpty (Showing top 20 results out of 315)

origin: GlowstoneMC/Glowstone

if (!json.isEmpty()) {
  String uuid = (String) ((JSONObject) json.get(0)).get("id");
  return UuidUtils.fromFlatString(uuid);
origin: pentaho/pentaho-kettle

@SuppressWarnings( "unchecked" )
private void outPutRow( Object[] rowData ) throws KettleStepException {
 // We can now output an object
 data.jg = new JSONObject();
 data.jg.put( data.realBlocName, data.ja );
 String value = data.jg.toJSONString();
 if ( data.outputValue && data.outputRowMeta != null ) {
  Object[] outputRowData = RowDataUtil.addValueData( rowData, data.inputRowMetaSize, value );
  incrementLinesOutput();
  putRow( data.outputRowMeta, outputRowData );
 }
 if ( data.writeToFile && !data.ja.isEmpty() ) {
  // Open a file
  if ( !openNewFile() ) {
   throw new KettleStepException( BaseMessages.getString(
    PKG, "JsonOutput.Error.OpenNewFile", buildFilename() ) );
  }
  // Write data to file
  try {
   data.writer.write( value );
  } catch ( Exception e ) {
   throw new KettleStepException( BaseMessages.getString( PKG, "JsonOutput.Error.Writing" ), e );
  }
  // Close file
  closeFile();
 }
 // Data are safe
 data.rowsAreSafe = true;
 data.ja = new JSONArray();
}
origin: jitsi/jitsi-videobridge

public static void deserializeHeaderExtensions(
  JSONArray headerExtensions,
  ColibriConferenceIQ.Channel channelIQ)
{
  if ((headerExtensions != null) && !headerExtensions.isEmpty())
  {
    for (Object headerExtension : headerExtensions)
    {
      deserializeHeaderExtension((JSONObject) headerExtension, channelIQ);
    }
  }
}
origin: jitsi/jitsi-videobridge

public static void deserializePayloadTypes(
    JSONArray payloadTypes,
    ColibriConferenceIQ.Channel channelIQ)
{
  if ((payloadTypes != null) && !payloadTypes.isEmpty())
  {
    for (Object payloadType : payloadTypes)
    {
      deserializePayloadType((JSONObject) payloadType, channelIQ);
    }
  }
}
origin: jitsi/jitsi-videobridge

public static void deserializeContents(
    JSONArray contents,
    ColibriConferenceIQ conferenceIQ)
{
  if ((contents != null) && !contents.isEmpty())
  {
    for (Object content : contents)
    {
      deserializeContent((JSONObject) content, conferenceIQ);
    }
  }
}
origin: jitsi/jitsi-videobridge

public static void deserializeFingerprints(
    JSONArray fingerprints,
    IceUdpTransportPacketExtension transportIQ)
{
  if ((fingerprints != null) && !fingerprints.isEmpty())
  {
    for (Object fingerprint : fingerprints)
    {
      deserializeFingerprint((JSONObject) fingerprint, transportIQ);
    }
  }
}
origin: jitsi/jitsi-videobridge

public static void deserializeSourceGroups(
    JSONArray sourceGroups,
    ColibriConferenceIQ.Channel channelIQ)
{
  if ((sourceGroups != null) && !sourceGroups.isEmpty())
  {
    for (Object sourceGroup : sourceGroups)
    {
      deserializeSourceGroup(sourceGroup, channelIQ);
    }
  }
}
origin: jitsi/jitsi-videobridge

public static void deserializeChannels(
    JSONArray channels,
    ColibriConferenceIQ.Content contentIQ)
{
  if ((channels != null) && !channels.isEmpty())
  {
    for (Object channel : channels)
    {
      deserializeChannel((JSONObject) channel, contentIQ);
    }
  }
}
origin: jitsi/jitsi-videobridge

public static void deserializeSources(
    JSONArray sources,
    ColibriConferenceIQ.Channel channelIQ)
{
  if ((sources != null) && !sources.isEmpty())
  {
    for (Object source : sources)
    {
      deserializeSource(source, channelIQ);
    }
  }
}
origin: jitsi/jitsi-videobridge

public static void deserializeEndpoints(
    JSONArray endpoints,
    ColibriConferenceIQ conferenceIQ)
{
  if ((endpoints != null) && !endpoints.isEmpty())
  {
    for (Object endpoint : endpoints)
    {
      deserializeEndpoint(
          (JSONObject) endpoint,
          conferenceIQ);
    }
  }
}
origin: jitsi/jitsi-videobridge

public static void deserializeChannelBundles(
    JSONArray channelBundles,
    ColibriConferenceIQ conferenceIQ)
{
  if ((channelBundles != null) && !channelBundles.isEmpty())
  {
    for (Object channelBundle : channelBundles)
    {
      deserializeChannelBundle(
          (JSONObject) channelBundle,
          conferenceIQ);
    }
  }
}
origin: jitsi/jitsi-videobridge

public static void deserializeSctpConnections(
    JSONArray sctpConnections,
    ColibriConferenceIQ.Content contentIQ)
{
  if ((sctpConnections != null) && !sctpConnections.isEmpty())
  {
    for (Object sctpConnection : sctpConnections)
    {
      deserializeSctpConnection(
          (JSONObject) sctpConnection,
          contentIQ);
    }
  }
}
origin: jitsi/jitsi-videobridge

public static void deserializeCandidates(
    JSONArray candidates,
    IceUdpTransportPacketExtension transportIQ)
{
  if ((candidates != null) && !candidates.isEmpty())
  {
    for (Object candidate : candidates)
    {
      deserializeCandidate(
          (JSONObject) candidate,
          CandidatePacketExtension.class,
          transportIQ);
    }
  }
}
origin: apache/metron

private boolean replaceKeyArray(JSONObject payload, String toKey, String[] fromKeys) {
 for (String fromKey : fromKeys) {
  if (payload.containsKey(fromKey)) {
   JSONArray value = (JSONArray) payload.remove(fromKey);
   if (value != null && !value.isEmpty()) {
    payload.put(toKey, value.get(0));
    _LOG.trace("[Metron] Added {} to {}", toKey, payload);
    return true;
   }
  }
 }
 return false;
}
origin: jitsi/jitsi-videobridge

public static void deserializeSSRCs(
    JSONArray ssrcs,
    ColibriConferenceIQ.Channel channelIQ)
{
  if ((ssrcs != null) && !ssrcs.isEmpty())
  {
    for (Object ssrc : ssrcs)
    {
      int ssrcIQ;
      try
      {
        ssrcIQ = deserializeSSRC(ssrc);
      }
      catch (NumberFormatException nfe)
      {
        continue;
      }
      channelIQ.addSSRC(ssrcIQ);
    }
  }
}
origin: i2p/i2p.i2p

if (list == null || list.isEmpty()) {
  log("No answer");
  return null;
origin: dboissier/jenkins-control-plugin

private List<String> getChoices(JSONArray choiceObjs) {
  List<String> choices = new LinkedList<String>();
  if (choiceObjs == null || choiceObjs.isEmpty()) {
    return choices;
  }
  for (Object choiceObj : choiceObjs) {
    choices.add((String) choiceObj);
  }
  return choices;
}
origin: apache/oozie

private void addQueueMessages(JSONObject json,
               List<String> queueMessages,
               String queueName,
               String queueValue,
               String headerMessage,
               String emptyMessage) {
  JSONArray queueDumpArray = (JSONArray) json.get(queueName);
  queueMessages.add(headerMessage);
  for (Object o : queueDumpArray) {
    JSONObject entry = (JSONObject) o;
    if (entry.get(queueValue) != null) {
      String value = (String) entry.get(queueValue);
      queueMessages.add(value);
    }
  }
  if (queueDumpArray.isEmpty()) {
    queueMessages.add(emptyMessage);
  }
}
origin: org.geotools/gt-mbstyle

/**
 * Translate "$type": the feature type we need This key may be used with the "==", "!=", "in",
 * and "!in" operators. Possible values are "Point", "LineString", and "Polygon".
 *
 * @return
 */
public Set<SemanticType> semanticTypeIdentifiers() {
  if (json == null || json.isEmpty()) {
    return semanticTypeIdentifiersDefaults();
  }
  Set<SemanticType> semanticTypes = semanticTypeIdentifiers(json);
  return semanticTypes.isEmpty() ? semanticTypeIdentifiersDefaults() : semanticTypes;
}
origin: apache/oozie

  public Void call() throws Exception {
    URL url = createURL(RestConstants.ADMIN_TIME_ZONES_RESOURCE, Collections.EMPTY_MAP);
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    conn.setRequestMethod("GET");
    assertEquals(HttpServletResponse.SC_OK, conn.getResponseCode());
    assertTrue(conn.getHeaderField("content-type").startsWith(RestConstants.JSON_CONTENT_TYPE));
    JSONObject json = (JSONObject) JSONValue.parse(new InputStreamReader(conn.getInputStream()));
    assertTrue(json.containsKey(JsonTags.AVAILABLE_TIME_ZONES));
    JSONArray array = (JSONArray) json.get(JsonTags.AVAILABLE_TIME_ZONES);
    assertFalse(array.isEmpty());
    return null;
  }
});
org.json.simpleJSONArrayisEmpty

Popular methods of JSONArray

  • <init>
    Constructs a JSONArray containing the elements of the specified collection, in the order they are re
  • add
  • size
  • get
  • toJSONString
  • iterator
  • addAll
  • toString
  • toArray
  • writeJSONString
  • contains
  • remove
  • contains,
  • remove,
  • set,
  • clear,
  • forEach,
  • getJsonObject,
  • listIterator,
  • subList

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top 12 Jupyter Notebook extensions
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