public Optional < Job > getOptionalJob ( Object projectIdOrPath , int jobId ) { try { return ( Optional . ofNullable ( getJob ( projectIdOrPath , jobId ) ) ) ; } catch ( GitLabApiException glae ) { return ( GitLabApi . createOptionalFromException ( glae ) ) ; } }
Get single job in a project as an Optional instance .