BoxUser extends BoxCollaborator { 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; } BoxUser();  BoxUser(JsonObject object); static BoxUser createFromId(String userId); String getLogin(); Role getRole(); String getLanguage(); String getTimezone(); Long getSpaceAmount(); Long getSpaceUsed(); Long getMaxUploadSize(); Status getStatus(); String getJobTitle(); String getPhone(); String getAddress(); @Deprecated //Use BoxApiUser.getDownloadAvatarRequest String getAvatarURL(); List<String> getTrackingCodes(); Boolean getCanSeeManagedUsers(); Boolean getIsSyncEnabled(); Boolean getIsExternalCollabRestricted(); Boolean getIsExemptFromDeviceLimits(); Boolean getIsExemptFromLoginVerification(); BoxEnterprise getEnterprise(); String getHostname(); List<String> getMyTags(); static final String TYPE; static final String FIELD_LOGIN; static final String FIELD_ROLE; static final String FIELD_LANGUAGE; static final String FIELD_TIMEZONE; static final String FIELD_SPACE_AMOUNT; static final String FIELD_SPACE_USED; static final String FIELD_MAX_UPLOAD_SIZE; static final String FIELD_STATUS; static final String FIELD_JOB_TITLE; static final String FIELD_PHONE; static final String FIELD_ADDRESS; static final String FIELD_AVATAR_URL; static final String FIELD_TRACKING_CODES; static final String FIELD_CAN_SEE_MANAGED_USERS; static final String FIELD_IS_SYNC_ENABLED; static final String FIELD_IS_EXTERNAL_COLLAB_RESTRICTED; static final String FIELD_IS_EXEMPT_FROM_DEVICE_LIMITS; static final String FIELD_IS_EXEMPT_FROM_LOGIN_VERIFICATION; static final String FIELD_ENTERPRISE; static final String FIELD_HOSTNAME; static final String FIELD_MY_TAGS; static final String[] ALL_FIELDS; }
@Test public void testCreateFromId() { String expectedId = "5"; String expectedType = BoxUser.TYPE; BoxUser user = BoxUser.createFromId(expectedId); String id = user.getId(); String type = user.getType(); Assert.assertEquals(expectedId, id); Assert.assertEquals(expectedType, type); }