/** * Reads the meta data from a row in the schedule store. * * @throws IllegalStateException if one of the expected fields is missing or ill-formed. */ private ProgramScheduleMeta extractMetaFromRow(ScheduleId scheduleId, Row row) { Long updatedTime = row.getLong(UPDATED_COLUMN_BYTES); String statusString = row.getString(STATUS_COLUMN_BYTES); try { Preconditions.checkArgument(updatedTime != null, "Last-updated timestamp is null"); Preconditions.checkArgument(statusString != null, "schedule status is null"); ProgramScheduleStatus status = ProgramScheduleStatus.valueOf(statusString); return new ProgramScheduleMeta(status, updatedTime); } catch (IllegalArgumentException e) { throw new IllegalStateException( String.format("Unexpected stored meta data for schedule %s: %s", scheduleId, e.getMessage())); } }
/** * Reads the meta data from a row in the schedule store. * * @throws IllegalStateException if one of the expected fields is missing or ill-formed. */ private ProgramScheduleMeta extractMetaFromRow(ScheduleId scheduleId, Row row) { Long updatedTime = row.getLong(UPDATED_COLUMN_BYTES); String statusString = row.getString(STATUS_COLUMN_BYTES); try { Preconditions.checkArgument(updatedTime != null, "Last-updated timestamp is null"); Preconditions.checkArgument(statusString != null, "schedule status is null"); ProgramScheduleStatus status = ProgramScheduleStatus.valueOf(statusString); return new ProgramScheduleMeta(status, updatedTime); } catch (IllegalArgumentException e) { throw new IllegalStateException( String.format("Unexpected stored meta data for schedule %s: %s", scheduleId, e.getMessage())); } }
ProgramScheduleStatus programScheduleStatus; try { programScheduleStatus = scheduleStatus == null ? null : ProgramScheduleStatus.valueOf(scheduleStatus); } catch (IllegalArgumentException e) { throw new BadRequestException(String.format("Invalid schedule status '%s'. Must be one of %s.",
ProgramScheduleStatus programScheduleStatus; try { programScheduleStatus = scheduleStatus == null ? null : ProgramScheduleStatus.valueOf(scheduleStatus); } catch (IllegalArgumentException e) { throw new BadRequestException(String.format("Invalid schedule status '%s'. Must be one of %s.",
status = statusStr == null ? null : ProgramScheduleStatus.valueOf(statusStr); } catch (IllegalArgumentException e) { throw new BadRequestException(String.format("Invalid schedule status '%s'. Must be one of %s.",
status = statusStr == null ? null : ProgramScheduleStatus.valueOf(statusStr); } catch (IllegalArgumentException e) { throw new BadRequestException(String.format("Invalid schedule status '%s'. Must be one of %s.",