public Optional < Snippet > getOptionalSnippet ( Integer snippetId , boolean downloadContent ) { try { return ( Optional . ofNullable ( getSnippet ( snippetId , downloadContent ) ) ) ; } catch ( GitLabApiException glae ) { return ( GitLabApi . createOptionalFromException ( glae ) ) ; } }
Get a specific snippet as an Optional instance .