package ch.heigvd.res.labs.roulette.net.protocol;

import ch.heigvd.res.labs.roulette.data.Student;
import java.util.List;

/**
 * This class is used to serialize/deserialize the response sent by the server
 * when processing the "LIST" command defined in the protocol specification. The
 * JsonObjectMapper utility class can use this class.
 *
 * @author Dbnsky & Iamfonky
 */

public class ListCommandResponse {
    private List<Student> listStudent;

    public ListCommandResponse(){

    }

    public ListCommandResponse(List<Student> list) {
        this.listStudent = list;
    }

    public List<Student> getList() {
        return listStudent;
    }

    public Student getAtList(int index){
        return listStudent.get(index);
    }

}

@@ -92,16 +92,74 @@
 Student;
+%0A%0Aimport java.lang.reflect.Array;%0Aimport java.util.Arrays;
 %0Aimport 
@@ -477,29 +477,25 @@
 private 
-List%3C
 Student
-%3E
+%5B%5D
  listStu
@@ -592,24 +592,25 @@
 nt%3E list) %7B%0A
+%0A
         this
@@ -624,20 +624,42 @@
 udent = 
-list
+(Student%5B%5D) list.toArray()
 ;%0A    %7D%0A
@@ -703,32 +703,46 @@
 %0A        return 
+Arrays.asList(
 listStudent;%0A   
@@ -736,16 +736,17 @@
 tStudent
+)
 ;%0A    %7D%0A
@@ -817,19 +817,15 @@
 dent
-.get(
+%5B
 index
-)
+%5D
 ;%0A  

constr. par défaut