Package com.cumulocity.me.lang

Examples of com.cumulocity.me.lang.Iterator


        }
        return findConverter(expectedType).fromJson(json);
    }
   
    private JsonConverter findConverter(Class representationType) {
      Iterator iterator = converters.iterator();
        while (iterator.hasNext()) {
            JsonConverter jsonConverter = ((JsonConverter) iterator.next());
            if (jsonConverter.supports(representationType)) {
                return jsonConverter;
            }
        }
        throw new ConversionException("Unsupported representation: " + representationType);
View Full Code Here


    private String createCommaSeparatedStringFromGids(List ids) {
        boolean atLeastOneItemProcessed = false;
        StringBuffer builder = new StringBuffer();

        Iterator i = ids.iterator();
        while (i.hasNext()) {
            GId gid = (GId) i.next();
            atLeastOneItemProcessed = true;
            builder.append(gid.getValue());
            builder.append(",");
        }
View Full Code Here

    protected void basePropertiesToJson(BaseResourceRepresentation representation, JSONObject json) {
        super.basePropertiesToJson(representation, json);
        AbstractExtensibleRepresentation r = (AbstractExtensibleRepresentation) representation;
        Map attrs = r.getAttrs();
        if (!attrs.isEmpty()) {
            Iterator i = attrs.entrySet().iterator();
            while (i.hasNext()) {
                Entry entry = (Entry) i.next();
                String propertyName = (String) entry.getKey();
                Object propertyValue = entry.getValue();
                putObject(json, propertyName, propertyValue);
            }
        }
View Full Code Here

        }
    }

    protected void putList(JSONObject json, String key, List array) {
        JSONArray jsonarray = new JSONArray();
        Iterator iterator = array.iterator();
        while (iterator.hasNext()) {
            jsonarray.put(conversionService.toJson((ResourceRepresentation) iterator.next()));
        }
        json.putOpt(key, jsonarray);
    }
View Full Code Here

    }

    protected void putSet(JSONObject json, String key, Set set) {
        if (set != null) {
            JSONArray jsonarray = new JSONArray();
            Iterator iterator = set.iterator();
            while (iterator.hasNext()) {
                jsonarray.put(conversionService.toJson((ResourceRepresentation) iterator.next()));
            }
            json.putOpt(key, jsonarray);
        }
    }
View Full Code Here

    // ------------------------------------------------------------------------

    @When("I create all Events$")
    public void iCreateAll() throws SDKException {
        try {
            Iterator iterator = input.iterator();
            while (iterator.hasNext()) {
                EventRepresentation resultt = eventApi.create((EventRepresentation) iterator.next());
                result.add(resultt);
            }
        } catch (SDKException ex) {
            status = ex.getHttpStatus();
        }
View Full Code Here

    // Then
    // ------------------------------------------------------------------------

    @Then("All Events should be created$")
    public void shouldBeCreated() {
        Iterator iterator = result.iterator();
        while (iterator.hasNext()) {
            assertThat(((EventRepresentation) iterator.next()).getId(), is(notNullValue()));
        }
    }
View Full Code Here

            measOn1stPage = getMeasurementsFrom1stPage();
        }
    }

    private void deleteMeasurements(List measOn1stPage) throws SDKException {
        Iterator iterator = measOn1stPage.iterator();
        while (iterator.hasNext()) {
            measurementApi.deleteMeasurement((MeasurementRepresentation) iterator.next());
        }
    }
View Full Code Here

        for (MeasurementRepresentation rep : result1) {
            map.put(rep.getId(), rep);
        }

        Iterator iterator = collection1.getMeasurements().iterator();
        while (iterator.hasNext()) {
            MeasurementRepresentation orig = (MeasurementRepresentation) map.get(((MeasurementRepresentation) iterator.next()).getId());
            assertThat(orig, is(notNullValue()));
        }
    }
View Full Code Here

            mosOn1stPage = getMOsFrom1stPage();
        }
    }

    private void deleteMOs(List mosOn1stPage) throws SDKException {
        Iterator iterator = mosOn1stPage.iterator();
        while (iterator.hasNext()) {
            inventoryApi.getManagedObject(((ManagedObjectRepresentation) iterator.next()).getId()).delete();
        }
    }
View Full Code Here

TOP

Related Classes of com.cumulocity.me.lang.Iterator

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.