Examples of RaceDTO


Examples of cz.muni.fi.pa165.ddtroops.dto.RaceDTO

        String path = request.getPathInfo();
       
        if (RestHelpers.isRoot(path)) {
           
            try {
                RaceDTO r = mapper.readValue(request.getInputStream(), RaceDTO.class);
                service.create(r);
                response.setHeader("Location", path);
            } catch (IllegalArgumentException | NullPointerException e) {
                RestHelpers.printErrorMessage(response);
            }
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.dto.RaceDTO

        request.setCharacterEncoding("utf-8");
        String path = request.getPathInfo();
       
        if (RestHelpers.isNonnegative(RestHelpers.getFirst(path))) {
            try {
                RaceDTO r = mapper.readValue(request.getInputStream(), RaceDTO.class);
               
                r.id = (long) Integer.parseInt(RestHelpers.getFirst(path));
               
                service.update(r);
            } catch (IllegalArgumentException | NullPointerException e) {
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.dto.RaceDTO

                                createRace.getIntelligence(),
                                createRace.getWisdom(),
                                createRace.getCharisma()));
                    break;
                case "updaterace":
                    RaceDTO r = rs.createNewRace(
                                updateRace.getName(),
                                updateRace.getDescription(),
                                updateRace.getStrength(),
                                updateRace.getDexterity(),
                                updateRace.getConstitution(),
                                updateRace.getIntelligence(),
                                updateRace.getWisdom(),
                                updateRace.getCharisma());
                    r.id = updateRace.getId();
                    rs.update(r);
                    break;
                case "createskill":
                    ss.create(
                            ss.createNewSkill(
                                createSkill.getName(),
                                createSkill.getDescription(),
                                createSkill.getProfession(),
                                createSkill.getMinXP()));
                    break;
                case "updateskill":
                    SkillDTO s = ss.createNewSkill(
                                updateSkill.getName(),
                                updateSkill.getDescription(),
                                updateSkill.getProfession(),
                                updateSkill.getMinXP());
                    s.id = updateSkill.getId();
                    ss.update(s);
                    break;
                case "find":
                    if(findCommand.getType().equals("skill"))
                        System.out.println("Returned object: " + ss.getById(findCommand.getId()));
                    else
                        System.out.println("Returned object: " + rs.getById(findCommand.getId()));
                    break;
                case "delete":
                    if(deleteCommand.getType().equals("skill"))
                    {
                        SkillDTO s1 = new SkillDTO();
                        s1.id = deleteCommand.getId();
                        ss.delete(s1);
                    }
                    else
                    {
                        RaceDTO r1 = new RaceDTO();
                        r1.id = deleteCommand.getId();
                        rs.delete(r1);
                    }
                    break;
            }
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.dto.RaceDTO

        rt.setMessageConverters(l);
    }
   
    @Override
    public RaceDTO createNewRace(String name, String description, Byte strength, Byte dexterity, Byte constitution, Byte intelligence, Byte wisdom, Byte charisma) {
        RaceDTO race = new RaceDTO();
        race.charisma = charisma;
        race.constitution = constitution;
        race.description = description;
        race.dexterity = dexterity;
        race.intelligence = intelligence;
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.dto.RaceDTO

        service.create(raceDTO);
        verify(dao).create(race);
    }
    @Test
    public void testCreateNewRace(){
        RaceDTO newRaceDTO = service.createNewRace("name", "desc", Byte.MIN_VALUE,
                Byte.MIN_VALUE, Byte.MIN_VALUE, Byte.MIN_VALUE,
                Byte.MIN_VALUE, Byte.MIN_VALUE);
        assertNotNull(newRaceDTO);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.