コード例 #1
0
  public boolean resultIdAlreadyExists(final String resultID) {
    List<FittsResult> results = fittsResultRepository.findAll();

    for (FittsResult resultIt : results) {
      if (resultIt.getResultID().equals(resultID)) {
        return true;
      }
    }

    return false;
  }
コード例 #2
0
  private boolean isDuplicatedResultId(final FittsResult result) {
    List<FittsResult> results = fittsResultRepository.findAll();

    for (FittsResult resultIt : results) {
      if (resultIt.getTestID().equals(result.getTestID())
          && !resultIt.getId().equals(result.getId())) {
        // Two different test objects with the same resultID
        return true;
      }
    }

    return false;
  }