Package org.bitbucket.andyrobr.clever.models

Examples of org.bitbucket.andyrobr.clever.models.Student


        assertNotNull(studentsInDistrict);
        assertTrue(studentsInDistrict.size() == 1);

        assertEquals(studentsInDistrict.get(0), students.get(0));

        Student student = clever.getStudent(studentsInDistrict.get(0).getId());

        assertEquals(student, students.get(0));
    }
View Full Code Here


        // TODO I'm creating a new object mapper here because my original mapper has an instance of the deserializer
        // associated with it. Therefore, if I try to read the value using codec, I'll get an infinite loop (it'll come
        // back here).
        ObjectMapper mapper = new ObjectMapper();
        Student student = mapper.readValue(node, Student.class);

        // Apply nested properties by hand
        JsonNode locationNode = node.get("location");
        JsonNode nameNode = node.get("name");

        student.setHispanicEthnicity(node.get("hispanic_ethnicity").getTextValue() == "Y");

        student.setPostalCode(locationNode.get("zip").getTextValue());

        student.setFirstName(nameNode.get("first").getTextValue());
        student.setMiddleInitial(nameNode.get("middle").getTextValue());
        student.setLastName(nameNode.get("last").getTextValue());

        return student;
    }
View Full Code Here

TOP

Related Classes of org.bitbucket.andyrobr.clever.models.Student

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.