Examples of findPath()


Examples of com.fasterxml.jackson.databind.JsonNode.findPath()

  public static Result createRole(String name){
    String inheritedRole=DefaultRoles.REGISTERED_USER.toString();
    String description="";
    JsonNode json = request().body().asJson();
    if(json != null) {
      description = Objects.firstNonNull(json.findPath("description").textValue(),"");
    }
    try {
      RoleService.createRole(name, inheritedRole, description);
    } catch (RoleNotFoundException e) {
      return badRequest("Role " + inheritedRole + " does not exist. Hint: check the 'inheritedRole' in your payload");
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.findPath()

  public static Result editRole(String name){
    String description="";
    String newName="";
    JsonNode json = request().body().asJson();
    if(json != null) {
      description = json.findPath("description").textValue();
      newName = json.findPath("new_name").textValue();
    }
    try {
      RoleService.editRole(name, null, description,newName);
    } catch (RoleNotModifiableException e) {
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.findPath()

    String description="";
    String newName="";
    JsonNode json = request().body().asJson();
    if(json != null) {
      description = json.findPath("description").textValue();
      newName = json.findPath("new_name").textValue();
    }
    try {
      RoleService.editRole(name, null, description,newName);
    } catch (RoleNotModifiableException e) {
      return badRequest("Role " + name + " is not modifiable");
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.findPath()

    @BodyParser.Of(BodyParser.Json.class)
    public static Result post() {
      JsonNode json = request().body().asJson();
      ObjectNode result = Json.newObject();
      String name = json.findPath("name").textValue();
      result.put("result", "Body of proof that " + name + " exists!");
      return ok(result);
    }
}
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.findPath()

        public Result sayHello() {
            JsonNode json = request().body().asJson();
            if(json == null) {
                return badRequest("Expecting Json data");
            } else {
                String name = json.findPath("name").textValue();
                if(name == null) {
                    return badRequest("Missing parameter [name]");
                } else {
                    return ok("Hello " + name);
                }
View Full Code Here

Examples of com.fasterxml.jackson.databind.JsonNode.findPath()

    static class JsonRequestAsJsonAction extends MockJavaAction {
        //#json-request-as-json
        @BodyParser.Of(BodyParser.Json.class)
        public Result sayHello() {
            JsonNode json = request().body().asJson();
            String name = json.findPath("name").textValue();
            if(name == null) {
                return badRequest("Missing parameter [name]");
            } else {
                return ok("Hello " + name);
            }
View Full Code Here

Examples of org.freerealm.map.PathFinder.findPath()

        }
        PathFinder pathFinder = realm.getPathFinder();
        if (pathFinder == null) {
            return new CommandResult(CommandResult.RESULT_ERROR, "PathFinder for realm is null.");
        }
        Path path = pathFinder.findPath(unit, coordinate, true);
        if (path == null) {
            String errorMessage = "There is not any path from unit's current location to target tile\n";
            errorMessage = errorMessage + "Units location : " + unit.getCoordinate();
            errorMessage = errorMessage + " Target coordinate :" + coordinate;
            return new CommandResult(CommandResult.RESULT_ERROR, errorMessage);
View Full Code Here

Examples of org.freerealm.map.PathFinder.findPath()

        }
        PathFinder pathFinder = realm.getPathFinder();
        if (pathFinder == null) {
            return new CommandResult(CommandResult.RESULT_ERROR, "PathFinder for realm is null.");
        }
        Path path = pathFinder.findPath(unit, coordinate, false);
        if (path == null) {
            String errorMessage = "There is not any path from unit's current location to target tile\n";
            errorMessage = errorMessage + "Units location : " + unit.getCoordinate();
            errorMessage = errorMessage + " Target coordinate :" + coordinate;
            return new CommandResult(CommandResult.RESULT_ERROR, errorMessage);
View Full Code Here

Examples of org.xmlBlaster.util.property.Property.findPath()

            }
         } // end of if ()
        
         if ( is == null) {
            // Use xmlBlaster way of searching
            FileInfo i = p.findPath(propFile);
            if ( i != null) {
               is = i.getInputStream();
            } // end of if ()

         } // end of if ()
View Full Code Here

Examples of rlforj.pathfinding.AStar.findPath()

                if (!m.isObstacle(startx, starty) && !m.isObstacle(endx, endy))
                    break;
            }
            AStar algo = new AStar(m, w, h);
           
            Point2I[] path = algo.findPath(startx, starty, endx, endy);
            if (path != null)
            {
                // Check path
                for (Point2I step: path)
                {
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.