Source:
private PagedResources buildPage(List<String> geneIds, String species, String assembly, List<String> studies, List<String> consequenceType, String maf, String polyphenScore, String siftScore, String annotationVepVersion, String annotationVepCacheVersion, Integer bufferValue, PagedResources pagedResources, HttpServletResponse response, HttpServletRequest request) { int pageNumber = (int) pagedResources.getMetadata().getNumber(); int pageSize = (int) pagedResources.getMetadata().getSize(); int totalPages = (int) pagedResources.getMetadata().getTotalPages(); if (pageNumber > 0) { pagedResources.add(createPaginationLink(geneIds, species, assembly, studies, consequenceType, maf, polyphenScore, siftScore, annotationVepVersion, annotationVepCacheVersion, pageNumber - 1, pageSize, bufferValue, response, request, "prev")); pagedResources.add(createPaginationLink(geneIds, species, assembly, studies, consequenceType, maf, polyphenScore, siftScore, annotationVepVersion, annotationVepCacheVersion, pageNumber - 1, pageSize, bufferValue, response, request, "first")); } if (pageNumber < (totalPages - 1)) { pagedResources.add(createPaginationLink(geneIds, species, assembly, studies, consequenceType, maf, polyphenScore, siftScore, annotationVepVersion, annotationVepCacheVersion, pageNumber - 1, pageSize, bufferValue, response, request, "next")); pagedResources.add(createPaginationLink(geneIds, species, assembly, studies, consequenceType, maf, polyphenScore, siftScore, annotationVepVersion, annotationVepCacheVersion, pageNumber - 1, pageSize, bufferValue, response, request, "last")); } return pagedResources; }

Target:
private PagedResources buildPage(List<String> geneIds, String species, String assembly, List<String> studies, List<String> consequenceType, String maf, String polyphenScore, String siftScore, String annotationVepVersion, String annotationVepCacheVersion, Integer bufferValue, PagedResources pagedResources, HttpServletResponse response, HttpServletRequest request) { int pageNumber = (int) pagedResources.getMetadata().getNumber(); int pageSize = (int) pagedResources.getMetadata().getSize(); int totalPages = (int) pagedResources.getMetadata().getTotalPages(); if (pageNumber > 0) { pagedResources.add(createPaginationLink(geneIds, species, assembly, studies, consequenceType, maf, polyphenScore, siftScore, annotationVepVersion, annotationVepCacheVersion, pageNumber - 1, pageSize, bufferValue, response, request, "prev")); pagedResources.add(createPaginationLink(geneIds, species, assembly, studies, consequenceType, maf, polyphenScore, siftScore, annotationVepVersion, annotationVepCacheVersion, 0, pageSize, bufferValue, response, request, "first")); } if (pageNumber < (totalPages - 1)) { pagedResources.add(createPaginationLink(geneIds, species, assembly, studies, consequenceType, maf, polyphenScore, siftScore, annotationVepVersion, annotationVepCacheVersion, pageNumber + 1, pageSize, bufferValue, response, request, "next")); pagedResources.add(createPaginationLink(geneIds, species, assembly, studies, consequenceType, maf, polyphenScore, siftScore, annotationVepVersion, annotationVepCacheVersion, totalPages - 1, pageSize, bufferValue, response, request, "last")); } return pagedResources; }