use of com.eclipsesource.json.JsonObject in project hazelcast by hazelcast.
the class SlowOperationDetector_JsonTest method testJSON_SlowEntryProcessor.
@Test
public void testJSON_SlowEntryProcessor() {
for (int i = 0; i < 2; i++) {
map.executeOnEntries(getSlowEntryProcessor(3));
}
map.executeOnEntries(getSlowEntryProcessor(4));
map.executeOnEntries(getSlowEntryProcessor(3));
awaitSlowEntryProcessors();
logger.finest(getOperationStats(instance).toString());
JsonObject firstLogJsonObject = getSlowOperationLogsJsonArray(instance).get(0).asObject();
assertJSONContainsClassName(firstLogJsonObject, "SlowEntryProcessor");
assertEqualsStringFormat("Expected %d invocations, but was %d", 4, firstLogJsonObject.get("invocations").asArray().size());
}
use of com.eclipsesource.json.JsonObject in project box-android-sdk by box.
the class BoxUser method createFromId.
/**
* A convenience method to create an empty user with just the id and type fields set. This allows
* the ability to interact with the content sdk in a more descriptive and type safe manner
*
* @param userId the id of user to create
* @return an empty BoxUser object that only contains id and type information
*/
public static BoxUser createFromId(String userId) {
JsonObject object = new JsonObject();
object.add(BoxCollaborator.FIELD_ID, userId);
object.add(BoxCollaborator.FIELD_TYPE, BoxUser.TYPE);
BoxUser user = new BoxUser();
user.createFromJson(object);
return user;
}
use of com.eclipsesource.json.JsonObject in project box-android-sdk by box.
the class BoxBookmark method createFromId.
/**
* A convenience method to create an empty bookmark with just the id and type fields set. This allows
* the ability to interact with the content sdk in a more descriptive and type safe manner
*
* @param bookmarkId the id of folder to create
* @return an empty BoxBookmark object that only contains id and type information
*/
public static BoxBookmark createFromId(String bookmarkId) {
JsonObject object = new JsonObject();
object.add(BoxItem.FIELD_ID, bookmarkId);
object.add(BoxItem.FIELD_TYPE, BoxBookmark.TYPE);
return new BoxBookmark(object);
}
use of com.eclipsesource.json.JsonObject in project box-android-sdk by box.
the class BoxCollection method createFromId.
public static BoxCollection createFromId(String id) {
JsonObject object = new JsonObject();
object.add(FIELD_ID, id);
return new BoxCollection(object);
}
use of com.eclipsesource.json.JsonObject in project box-android-sdk by box.
the class BoxRequestUpdateSharedItem method setAccess.
/**
* Sets the shared link access for the item in the request.
*
* @param access new shared link access for the item.
* @return request with the updated shared link access.
*/
public R setAccess(BoxSharedLink.Access access) {
JsonObject jsonObject = getSharedLinkJsonObject();
jsonObject.add(BoxSharedLink.FIELD_ACCESS, SdkUtils.getAsStringSafely(access));
BoxSharedLink sharedLink = new BoxSharedLink(jsonObject);
mBodyMap.put(BoxItem.FIELD_SHARED_LINK, sharedLink);
return (R) this;
}
Aggregations