Skip to content

Commit

Permalink
Add 'getProperty' method to the node
Browse files Browse the repository at this point in the history
  • Loading branch information
kniazkov committed Jun 21, 2024
1 parent 8370ce1 commit dce4e9f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/org/cqfn/astranaut/core/base/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ public interface Node extends Iterable<Node> {
*/
Node getChild(int index);

/**
* Returns the value of some property (depends on implementation).
* @param name The name of property
* @return Property value (if the property is not defined, returns an empty string)
*/
default String getProperty(final String name) {
return this.getType().getProperty(name);
}

/**
* Returns the name of the type.
* @return The name
Expand Down

0 comments on commit dce4e9f

Please sign in to comment.