You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commonsrdf.apache.org by wi...@apache.org on 2015/03/27 19:15:14 UTC

[16/50] [abbrv] incubator-commonsrdf git commit: Javadoc Types.get

Javadoc Types.get

Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/424770c6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/424770c6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/424770c6

Branch: refs/heads/master
Commit: 424770c6eec6b169868c32064fd1414325280079
Parents: da9c4df
Author: Peter Ansell <p_...@yahoo.com>
Authored: Mon Jan 26 18:06:11 2015 +1100
Committer: Peter Ansell <p_...@yahoo.com>
Committed: Mon Jan 26 18:06:11 2015 +1100

----------------------------------------------------------------------
 .../java/com/github/commonsrdf/simple/Types.java   | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/424770c6/simple/src/main/java/com/github/commonsrdf/simple/Types.java
----------------------------------------------------------------------
diff --git a/simple/src/main/java/com/github/commonsrdf/simple/Types.java b/simple/src/main/java/com/github/commonsrdf/simple/Types.java
index e135551..3fbb577 100644
--- a/simple/src/main/java/com/github/commonsrdf/simple/Types.java
+++ b/simple/src/main/java/com/github/commonsrdf/simple/Types.java
@@ -171,11 +171,20 @@ public enum Types implements IRI {
 	public String ntriplesString() {
 		return this.field.ntriplesString();
 	}
-	
+
+	/**
+	 * Get the IRI from this enum if it is present, or return
+	 * {@link Optional#empty()} otherwise.
+	 * 
+	 * @param nextIRI
+	 *            The IRI to look for.
+	 * @return An {@link Optional} containing the IRI from this enum or
+	 *         {@link Optional#empty()} if it is not present here.
+	 */
 	public static Optional<IRI> get(IRI nextIRI) {
-		for(IRI nextType : values()) {
-			if(nextType.equals(nextIRI)) {
-				return Optional.of(nextType); 
+		for (IRI nextType : values()) {
+			if (nextType.equals(nextIRI)) {
+				return Optional.of(nextType);
 			}
 		}
 		return Optional.empty();