Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cesium-plus-pod
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
14
Issues
14
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clients
Cesium-grp
cesium-plus-pod
Commits
c528f6cd
Commit
c528f6cd
authored
Feb 12, 2019
by
Benoit Lavenier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] Return empty list, no more null, on DAO abstract toList() function
parent
265fb537
Pipeline
#4634
failed
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
AbstractDao.java
.../main/java/org/duniter/elasticsearch/dao/AbstractDao.java
+2
-1
No files found.
cesium-plus-pod-core/src/main/java/org/duniter/elasticsearch/dao/AbstractDao.java
View file @
c528f6cd
...
...
@@ -24,6 +24,7 @@ package org.duniter.elasticsearch.dao;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.common.collect.ImmutableList
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Sets
;
import
com.google.common.collect.Streams
;
...
...
@@ -93,7 +94,7 @@ public abstract class AbstractDao implements Bean {
}
protected
<
C
>
List
<
C
>
toList
(
SearchResponse
response
,
final
Function
<
SearchHit
,
C
>
mapper
)
{
if
(
response
.
getHits
()
==
null
||
response
.
getHits
().
getTotalHits
()
==
0
)
return
null
;
if
(
response
.
getHits
()
==
null
||
response
.
getHits
().
getTotalHits
()
==
0
)
return
ImmutableList
.
of
()
;
return
Arrays
.
stream
(
response
.
getHits
().
getHits
())
.
map
(
hit
->
mapper
.
apply
(
hit
))
.
filter
(
Objects:
:
nonNull
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment