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 <[email protected]> Authored: Mon Jan 26 18:06:11 2015 +1100 Committer: Peter Ansell <[email protected]> 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();
