- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {ArrayList a =
new ArrayList<String>()
new ArrayList()
new ArrayList<Object>()
- Smart code suggestions by Codota
}
public Optional<CeQueueDto> selectByUuid(DbSession session, String uuid) { return Optional.ofNullable(mapper(session).selectByUuid(uuid)); }
private Optional<CeQueueDto> tryToPeek(DbSession session, String eligibleTaskUuid, String workerUuid) { long now = system2.now(); int touchedRows = mapper(session).updateIf(eligibleTaskUuid, new UpdateIf.NewProperties(IN_PROGRESS, workerUuid, now, now), new UpdateIf.OldProperties(PENDING)); if (touchedRows != 1) { return Optional.empty(); } CeQueueDto result = mapper(session).selectByUuid(eligibleTaskUuid); session.commit(); return Optional.ofNullable(result); }
public Optional<CeQueueDto> selectByUuid(DbSession session, String uuid) { return Optional.fromNullable(mapper(session).selectByUuid(uuid)); }
private Optional<CeQueueDto> tryToPeek(DbSession session, String taskUuid) { int touchedRows = mapper(session).updateIfStatus(taskUuid, IN_PROGRESS, system2.now(), system2.now(), PENDING); if (touchedRows != 1) { return Optional.absent(); } CeQueueDto result = mapper(session).selectByUuid(taskUuid); session.commit(); return Optional.of(result); }