Skip to content

Commit

Permalink
even more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mpollmeier committed May 27, 2024
1 parent eafcca6 commit 758b86a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/main/scala/flatgraph/traversal/Language.scala
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ class NodeMethods(node: GNode) extends AnyVal {
def propertyOption[ValueType](propertyKey: MultiPropertyKey[ValueType]): Option[IndexedSeq[ValueType]] =
Option(Accessors.getNodePropertyMulti(node.graph, node.nodeKind, propertyKey.kind, node.seq()))

/** lookup property value by name - warning, this may return `null` if property is unset */
def property[ValueType >: Null](name: String): ValueType =
propertyOption(name).orNull

def propertyOption[ValueType](name: String): Option[ValueType] = {
node.graph.schema.getPropertyKindByName(name) match {
case Schema.UndefinedKind =>
Expand Down

0 comments on commit 758b86a

Please sign in to comment.