public RequestEntity build() { return new RequestEntity(mId, mCreatedBy, mCreatedAt, mCreatedComment, mCreatedPictures, mCreatedVotes, mLatitude, mLongitude, mPickedUpBy, mPickedUpAt, mClosedBy, mClosedAt, mClosedComment, mClosedPictures, mClosedVotes, mLocation); } }
public static RequestEntity getPickedUpRequestEntity() { RequestEntity request = new RequestEntity( PICKED_UP_REQUEST_ENTITY_ID, REQUEST_CREATED_BY, REQUEST_CREATED_AT, REQUEST_CREATED_COMMENT, REQUEST_CREATED_PICTURES, REQUEST_CREATED_VOTES, REQUEST_LATITUDE, REQUEST_LONGITUDE, REQUEST_PICKED_UP_BY, REQUEST_PICKED_UP_AT, null, null, null, null, 0, REQUEST_LOCATION); return request; }
public static RequestEntity getClosedRequestEntity() { RequestEntity request = new RequestEntity( CLOSED_REQUEST_ENTITY_ID, REQUEST_CREATED_BY, REQUEST_CREATED_AT, REQUEST_CREATED_COMMENT, REQUEST_CREATED_PICTURES, REQUEST_CREATED_VOTES, REQUEST_LATITUDE, REQUEST_LONGITUDE, REQUEST_PICKED_UP_BY, REQUEST_PICKED_UP_AT, REQUEST_CLOSED_BY, REQUEST_CLOSED_AT, REQUEST_CLOSED_COMMENT, REQUEST_CLOSED_PICTURES, REQUEST_CLOSED_VOTES, REQUEST_LOCATION); return request; } }
public static RequestEntity getNewRequestEntity() { RequestEntity request = new RequestEntity( NEW_REQUEST_ENTITY_ID, REQUEST_CREATED_BY, REQUEST_CREATED_AT, REQUEST_CREATED_COMMENT, REQUEST_CREATED_PICTURES, REQUEST_CREATED_VOTES, REQUEST_LATITUDE, REQUEST_LONGITUDE, null, null, null, null, null, null, 0, REQUEST_LOCATION); return request; }
private static RequestEntity createRequestFromCurrentCursorPosisition(Cursor cursor) throws IllegalArgumentException { String requestId = cursor.getString(cursor.getColumnIndexOrThrow(Requests.COL_REQUEST_ID)); String createdBy = cursor.getString(cursor.getColumnIndexOrThrow(Requests.COL_CREATED_BY)); String createdAt = cursor.getString(cursor.getColumnIndexOrThrow(Requests.COL_CREATED_AT)); String createdComment = cursor.getString(cursor.getColumnIndexOrThrow(Requests.COL_CREATED_COMMENT)); List<String> createdPictures = StringUtils.commaSeparatedStringToList( cursor.getString(cursor.getColumnIndexOrThrow(Requests.COL_CREATED_PICTURES))); int createdVotes = cursor.getInt(cursor.getColumnIndexOrThrow(Requests.COL_CREATED_VOTES)); double latitude = cursor.getDouble(cursor.getColumnIndexOrThrow(Requests.COL_LATITUDE)); double longitude = cursor.getDouble(cursor.getColumnIndexOrThrow(Requests.COL_LONGITUDE)); String pickedUpBy = cursor.getString(cursor.getColumnIndexOrThrow(Requests.COL_PICKED_UP_BY)); String pickedUpAt = cursor.getString(cursor.getColumnIndexOrThrow(Requests.COL_PICKED_UP_AT)); String closedBy = cursor.getString(cursor.getColumnIndexOrThrow(Requests.COL_CLOSED_BY)); String closedAt = cursor.getString(cursor.getColumnIndexOrThrow(Requests.COL_CLOSED_AT)); String closedComment = cursor.getString(cursor.getColumnIndexOrThrow(Requests.COL_CLOSED_COMMENT)); List<String> closedPictures = StringUtils.commaSeparatedStringToList( cursor.getString(cursor.getColumnIndexOrThrow(Requests.COL_CLOSED_PICTURES))); int closedVotes = cursor.getInt(cursor.getColumnIndexOrThrow(Requests.COL_CLOSED_VOTES)); String location = cursor.getString(cursor.getColumnIndexOrThrow(Requests.COL_LOCATION)); return new RequestEntity(requestId, createdBy, createdAt, createdComment, createdPictures, createdVotes, latitude, longitude, pickedUpBy, pickedUpAt, closedBy, closedAt, closedComment, closedPictures, closedVotes, location); }
private RequestEntity convertSchemeToRequest(RequestScheme requestScheme) { return new RequestEntity( requestScheme.getId(), requestScheme.getCreatedBy(), requestScheme.getCreatedAt(), requestScheme.getCreatedComment(), parsePicturesList(requestScheme.getCreatedPictures()), requestScheme.getCreatedReputation(), requestScheme.getLatitude(), requestScheme.getLongitude(), requestScheme.getPickedUpBy(), requestScheme.getPickedUpAt(), requestScheme.getClosedBy(), requestScheme.getClosedAt(), requestScheme.getClosedComment(), parsePicturesList(requestScheme.getClosedPictures()), requestScheme.getClosedReputation(), ""); }