Package com.cumulocity.me.lang

Examples of com.cumulocity.me.lang.Map$Entry


public abstract class BaseExtensibleResourceRepresentationConverter extends BaseResourceRepresentationConverter {

    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


        CumulocityAlarmStatuses status = alarmFilter.getStatus();
        ManagedObjectRepresentation source = alarmFilter.getSource();
        Date dateFrom = alarmFilter.getFromDate();
        Date dateTo = alarmFilter.getToDate();

        Map filter = new HashMap();

        if (null != status) {
            filter.put(PARAMETER_STATUS, status.name());
        }
        if (null != source) {
            filter.put(PARAMETER_SOURCE, source.getId().getValue());
        }
        if (null != dateFrom) {
            filter.put(DATE_FROM, DateUtils.format(dateFrom));
        }
        if (null != dateTo) {
            filter.put(DATE_TO, DateUtils.format(dateTo));
        }

        QueryURLBuilder query = new QueryURLBuilder(templateUrlParser, filter, getAlarmsApiRepresentation().getURITemplates(),
                OPTIONAL_PARAMETERS);
        String queryUrl = query.build();
View Full Code Here

        return new AuditRecordCollectionImpl(restConnector, url, pageSize);
    }

    private PagedCollectionResource getAuditRecordsByType(String type) throws SDKException {
        String urlTemplate = getAuditRecordsRepresentation().getAuditRecordsForType();
        Map filter = new HashMap();
        filter.put(PARAMETER_TYPE, type);
        String url = templateUrlParser.replacePlaceholdersWithParams(urlTemplate, filter);
        return new AuditRecordCollectionImpl(restConnector, url, pageSize);
    }
View Full Code Here

        return new AuditRecordCollectionImpl(restConnector, url, pageSize);
    }

    private PagedCollectionResource getAuditRecordsByUser(String user) throws SDKException {
        String urlTemplate = getAuditRecordsRepresentation().getAuditRecordsForUser();
        Map filter = new HashMap();
        filter.put(PARAMETER_USER, user);
        String url = templateUrlParser.replacePlaceholdersWithParams(urlTemplate, filter);
        return new AuditRecordCollectionImpl(restConnector, url, pageSize);
    }
View Full Code Here

        return new AuditRecordCollectionImpl(restConnector, url, pageSize);
    }

    private PagedCollectionResource getAuditRecordsByApplication(String application) throws SDKException {
        String urlTemplate = getAuditRecordsRepresentation().getAuditRecordsForApplication();
        Map filter = new HashMap();
        filter.put(PARAMETER_APPLICATION, application);
        String url = templateUrlParser.replacePlaceholdersWithParams(urlTemplate, filter);
        return new AuditRecordCollectionImpl(restConnector, url, pageSize);
    }
View Full Code Here

        return new AuditRecordCollectionImpl(restConnector, url, pageSize);
    }

    private PagedCollectionResource getAuditRecordsByUserAndType(String user, String type) throws SDKException {
        String urlTemplate = getAuditRecordsRepresentation().getAuditRecordsForUserAndType();
        Map filter = new HashMap();
        filter.put(PARAMETER_USER, user);
        filter.put(PARAMETER_TYPE, type);
        String url = templateUrlParser.replacePlaceholdersWithParams(urlTemplate, filter);
        return new AuditRecordCollectionImpl(restConnector, url, pageSize);
    }
View Full Code Here

        return new AuditRecordCollectionImpl(restConnector, url, pageSize);
    }

    private PagedCollectionResource getAuditRecordsByUserAndApplication(String user, String application) throws SDKException {
        String urlTemplate = getAuditRecordsRepresentation().getAuditRecordsForUserAndApplication();
        Map filter = new HashMap();
        filter.put(PARAMETER_USER, user);
        filter.put(PARAMETER_APPLICATION, application);
        String url = templateUrlParser.replacePlaceholdersWithParams(urlTemplate, filter);
        return new AuditRecordCollectionImpl(restConnector, url, pageSize);
    }
View Full Code Here

        return new AuditRecordCollectionImpl(restConnector, url, pageSize);
    }

    private PagedCollectionResource getAuditRecordsByTypeAndApplication(String type, String application) throws SDKException {
        String urlTemplate = getAuditRecordsRepresentation().getAuditRecordsForTypeAndApplication();
        Map filter = new HashMap();
        filter.put(PARAMETER_TYPE, type);
        filter.put(PARAMETER_APPLICATION, application);
        String url = templateUrlParser.replacePlaceholdersWithParams(urlTemplate, filter);
        return new AuditRecordCollectionImpl(restConnector, url, pageSize);
    }
View Full Code Here

    }

    private PagedCollectionResource getAuditRecordsByTypeAndUserAndApplication(String user, String type, String application)
            throws SDKException {
        String urlTemplate = getAuditRecordsRepresentation().getAuditRecordsForTypeAndUserAndApplication();
        Map filter = new HashMap();
        filter.put(PARAMETER_USER, user);
        filter.put(PARAMETER_TYPE, type);
        filter.put(PARAMETER_APPLICATION, application);
        String url = templateUrlParser.replacePlaceholdersWithParams(urlTemplate, filter);
        return new AuditRecordCollectionImpl(restConnector, url, pageSize);
    }
View Full Code Here

    @Then("I should I get all the measurements")
    public void shouldGetAllMeasurements() {
        assertThat(collection1.getMeasurements().size(), is(equalTo(result1.size())));

        Map map = new HashMap();

        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

TOP

Related Classes of com.cumulocity.me.lang.Map$Entry

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.