You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by st...@apache.org on 2017/01/12 17:36:28 UTC
[40/50] [abbrv] commons-rdf git commit: java.util.Optional import
java.util.Optional import
Project: http://git-wip-us.apache.org/repos/asf/commons-rdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rdf/commit/902d2108
Tree: http://git-wip-us.apache.org/repos/asf/commons-rdf/tree/902d2108
Diff: http://git-wip-us.apache.org/repos/asf/commons-rdf/diff/902d2108
Branch: refs/heads/COMMONSRDF-47
Commit: 902d21083b8c0c9103a516bd13f3737e1548850d
Parents: 1f19fd8
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Mon Nov 21 14:30:43 2016 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Mon Nov 21 14:30:43 2016 +0000
----------------------------------------------------------------------
examples/src/example/IntroToRDF.java | 2 ++
src/site/markdown/introduction.md | 2 ++
2 files changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/902d2108/examples/src/example/IntroToRDF.java
----------------------------------------------------------------------
diff --git a/examples/src/example/IntroToRDF.java b/examples/src/example/IntroToRDF.java
index 58aea85..9de1297 100644
--- a/examples/src/example/IntroToRDF.java
+++ b/examples/src/example/IntroToRDF.java
@@ -17,8 +17,10 @@
*/
package example;
+import java.util.Optional;
import org.apache.commons.rdf.api.*;
import org.apache.commons.rdf.simple.SimpleRDF;
+import org.apache.commons.rdf.simple.Types;
/** See http://commonsrdf.incubator.apache.org/introduction.html
*/
http://git-wip-us.apache.org/repos/asf/commons-rdf/blob/902d2108/src/site/markdown/introduction.md
----------------------------------------------------------------------
diff --git a/src/site/markdown/introduction.md b/src/site/markdown/introduction.md
index 6d731e0..3e7cbd2 100644
--- a/src/site/markdown/introduction.md
+++ b/src/site/markdown/introduction.md
@@ -422,6 +422,8 @@ You can use `optional.isPresent()` and `optional.get()` to check if a
`Triple` matched the graph stream pattern:
```java
+import java.util.Optional;
+// ...
Optional<? extends Triple> nameTriple = graph.stream(alice, name, null).findAny();
if (nameTriple.isPresent()) {
System.out.println(nameTriple.get());