Package com.eclipsesource.json

Examples of com.eclipsesource.json.JsonArray


    details.add( "benchmark.executionTime", extractTimestamp( caliperResults ) );
    return details;
  }

  private static JsonArray extractMeasurements( JsonObject caliperResults ) {
    JsonArray result = new JsonArray();
    JsonArray measurements = caliperResults.get( "run" ).asObject().get( "measurements" ).asArray();
    for( JsonValue measurement : measurements ) {
      result.add( extractMeasurement( measurement.asObject() ) );
    }
    return result;
  }
View Full Code Here


      .add( "units", times.get( "unitNames" ) )
      .add( "values", extractTimes( times.get( "measurements" ).asArray() ) );
  }

  private static JsonValue extractTimes( JsonArray measurements ) {
    JsonArray result = new JsonArray();
    for( JsonValue measurement : measurements ) {
      result.add( measurement.asObject().get( "processed" ) );
    }
    return result;
  }
View Full Code Here

  private boolean equalsIgnoreOrder( JsonArray array1, JsonValue value2 ) {
    if( !value2.isArray() ) {
      return false;
    }
    JsonArray array2 = value2.asArray();
    if( array1.size() != array2.size() ) {
      return false;
    }
    for( int i = 0; i < array1.size(); i++ ) {
      if( !equalsIgnoreOrder( array2.get( i ), array2.get( i ) ) ) {
        return false;
      }
    }
    return true;
  }
View Full Code Here

TOP

Related Classes of com.eclipsesource.json.JsonArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.