Unverified Commit 83a05ad3 authored by Greg Messner's avatar Greg Messner Committed by GitHub
Browse files

Fixed code sample for Optional use.

parent c17f960b
......@@ -219,7 +219,7 @@ projectPager.lazyStream().limit(5).map(Project::getName).forEach(name -> System.
### **Java 8 Optional Support**
GitLab4J-API supports Java 8 Optional<T> for API calls that result in the return of a single item. Here is an example on how to use the Java 8 Optional<T> API calls:
```java
Optional<Group> optionalGroup = gitlabApi.getGroupApi().getGroup("my-group-path");
Optional<Group> optionalGroup = gitlabApi.getGroupApi().getOptionalGroup("my-group-path");
if (optionalGroup.isPresent())
return optionalGroup.get();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment