Package com.cumulocity.me.lang

Examples of com.cumulocity.me.lang.HashSet


        representation
        .withApplication(application)
        .withSeverity(severity)
        .withActivity(activity)
        .withUser(user)
        .withChanges(new HashSet());
       
        JSONObject json = converter.toJson(representation.build());

        assertThat(json.toString()).isEqualTo("{\"user\":\"us\",\"severity\":\"sever\",\"application\":\"app\",\"changes\":[],\"activity\":\"activity\"}");
    }
View Full Code Here


        converter.isValid(representation.build(), CREATE);
    }

    @Test(expected = RepresentationValidationException.class)
    public void shouldRequireNullChanges() throws Exception {
        representation.withActivity(activity).withSeverity(severity).withChanges(new HashSet());

        converter.isValid(representation.build(), CREATE);
    }
View Full Code Here

    protected Set getSet(JSONObject json, String propertyName, Class propertyElementType) {
        JSONArray jsonArray = json.optJSONArray(propertyName);
        if (jsonArray == null) {
            return null;
        }
        Set set = new HashSet();
        for (int i = 0; i < jsonArray.length(); i++) {
            set.add(conversionService.fromJson(jsonArray.getJSONObject(i), propertyElementType));
        }
        return set;
    }
View Full Code Here

TOP

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

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.