You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.asciidoc
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -157,6 +157,8 @@ This release also includes changes from <<release-3-7-XXX, 3.7.XXX>>.
157
157
* Deprecated `ProcessLimitedStandardSuite` and `ProcessLimitedComputerSuite` in favor of `ProcessEmbeddedStandardSuite` and `ProcessEmbeddedComputerSuite` respectively.
158
158
* Deprecated `ProcessStandardSuite` and the `ProcessComputerSuite` in favor of Gherkin testing and the `ProcessEmbeddedStandardSuite` and `ProcessEmbeddedComputerSuite` for testing JVM-specific Gremlin behaviors.
159
159
* Removed lambda oriented Gremlin testing from Gherkin test suite.
160
+
* Implemented `P.typeOf()` predicate.
161
+
* Added `GType` enum to denote types.
160
162
* Removed `P.getOriginalValue()` in favor of `P.getValue()`.
161
163
* Simplified comparability semantics from ternary boolean logic to binary logic.
*Description:* converts the incoming traverser to the nearest parsable type if no argument is provided, or to the desired numerical type, based on the number token (`N`) provided.
The `asNumber()`-step (*map*) converts the incoming traverser to the nearest parsable type if no argument is provided,
861
-
or to the desired numerical type, based on the number token (`N`) provided.
861
+
or to the desired numerical type, based on the type token (`GType`) provided. If a type token entered isn't a numerical type, an `IllegalArgumentException` will be thrown.
862
862
863
863
Numerical input will pass through unless a type is specified by the number token. `ArithmeticException` will be thrown
864
864
for any overflow during narrowing of types.
@@ -872,17 +872,13 @@ All other input types will result in `IllegalArgumentException`.
872
872
[gremlin-groovy,modern]
873
873
----
874
874
g.inject(1234).asNumber() <1>
875
-
g.inject(1.76).asNumber() <2>
876
-
g.inject(1.76).asNumber(N.int_) <3>
877
-
g.inject("1b").asNumber() <4>
878
-
g.inject(33550336).asNumber(N.byte_) <5>
875
+
g.inject(1.76d).asNumber() <2>
876
+
g.inject(1.76d).asNumber(GType.INT) <3>
879
877
----
880
878
881
879
<1> An int will be passed through.
882
880
<2> A double will be passed through.
883
881
<3> A double is converted into an int.
884
-
<4> String containing any character other than numerical ones will result in `NumberFormatException`.
885
-
<5> Narrowing of int to byte that overflows will throw `ArithmeticException`.
886
882
887
883
[NOTE, caption=Java]
888
884
====
@@ -5481,12 +5477,8 @@ a comparatively slow script compilation, which makes parameterization essential
5481
5477
[[a-note-on-predicates]]
5482
5478
== A Note on Predicates
5483
5479
5484
-
A `P` is a predicate of the form `Function<Object,Boolean>`. That is, given some object, return true or false. As of
5485
-
the release of TinkerPop 3.4.0, Gremlin also supports simple text predicates, which only work on `String` values. The `TextP`
5486
-
text predicates extend the `P` predicates, but are specialized in that they are of the form `Function<String,Boolean>`.
5487
-
The provided predicates are outlined in the table below and are used in various steps such as <<has-step,`has()`>>-step,
5488
-
<<where-step,`where()`>>-step, <<is-step,`is()`>>-step, etc. Two new additional `TextP` predicate members were added in the
5489
-
TinkerPop 3.6.0 release that allow working with regular expressions. These are `TextP.regex` and `TextP.notRegex`
5480
+
A `P` is a predicate of the form `Function<Object,Boolean>`. That is, given some object, return true or false. Gremlin
5481
+
supports text predicates (`TextP`), which are specialized predicates that only work on String values and are of the form `Function<String,Boolean>`. Additionally, type predicate (`P.typeOf`) supports filtering traversers based on their runtime types. The provided predicates are outlined in the table below and are used in various steps such as <<has-step,`has()`>>-step, <<where-step,`where()`>>-step, <<is-step,`is()`>>-step, etc.
0 commit comments