Java Code Examples for com.github.openjson.JSONObject#getLong()

The following examples show how to use com.github.openjson.JSONObject#getLong() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InvitationDTO.java    From openmeetings with Apache License 2.0 6 votes vote down vote up
public static InvitationDTO get(JSONObject o) {
	if (o == null) {
		return null;
	}
	InvitationDTO i = new InvitationDTO();
	i.firstname = o.optString("firstname");
	i.lastname = o.optString("lastname");
	i.email = o.optString("email");
	i.password = o.optString("password");
	i.passwordProtected = o.optBoolean("passwordProtected", false);
	i.subject = o.optString("subject");
	i.roomId = o.getLong("roomId");
	i.message = o.optString("message");
	i.valid = Valid.valueOf(o.optString("valid", Valid.PERIOD.name()));
	i.validFrom = o.optString("validFrom");
	i.validTo = o.optString("validTo");
	return i;
}
 
Example 2
Source File: RoomFileDTO.java    From openmeetings with Apache License 2.0 5 votes vote down vote up
public static RoomFileDTO get(JSONObject o) {
	if (o == null) {
		return null;
	}
	RoomFileDTO rf = new RoomFileDTO();
	rf.id = optLong(o, "id");
	rf.fileId = o.getLong("fileId");
	rf.wbIdx = optLong(o, "wbIdx");
	return rf;
}
 
Example 3
Source File: DtoHelper.java    From openmeetings with Apache License 2.0 4 votes vote down vote up
public static Long optLong(JSONObject o, String key) {
	return o.has(key) && !o.isNull(key) ? o.getLong(key) : null;
}