package org.gluu.oxtrust.model.scim2;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Rahat Ali Date: 05.08.2015
 * Udpated by jgomer on 2017-10-01.
 */
public class ListResponse {

    private int totalResults;
    private int startIndex;
    private int itemsPerPage;

    private List<BaseScimResource> resources;

    public ListResponse(int sindex, int ippage){
        totalResults=0;
        startIndex=sindex;
        itemsPerPage=ippage;
        resources =new ArrayList<BaseScimResource>();
    }

    public void addResource(BaseScimResource resource){
        resources.add(resource);
        totalResults++;
    }

    public int getTotalResults() {
        return totalResults;
    }

    public int getStartIndex() {
        return startIndex;
    }

    public int getItemsPerPage() {
        return itemsPerPage;
    }

    public List<BaseScimResource> getResources() {
        return resources;
    }

}

@@ -377,16 +377,27 @@
 t ippage
+, int total
 )%7B%0A     
@@ -412,17 +412,21 @@
 Results=
-0
+total
 ;%0A      
@@ -629,32 +629,8 @@
 e);%0A
-        totalResults++;%0A
     
@@ -888,24 +888,24 @@
 sources() %7B%0A
-
         retu
@@ -925,10 +925,118 @@
 %0A    %7D%0A%0A
+    public void setResources(List%3CBaseScimResource%3E resources) %7B%0A        this.resources = resources;%0A    %7D%0A%0A
 %7D%0A

Add total results to class constructor