Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
da49128e
Commit
da49128e
authored
Jun 15, 2018
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13487 from izeye:caches-endpoint
* pr/13487: Polish CachesEndpoint
parents
7ed06f33
403f8927
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
CachesEndpoint.java
...rg/springframework/boot/actuate/cache/CachesEndpoint.java
+7
-10
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cache/CachesEndpoint.java
View file @
da49128e
...
...
@@ -16,7 +16,6 @@
package
org
.
springframework
.
boot
.
actuate
.
cache
;
import
java.util.ArrayList
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -112,21 +111,19 @@ public class CachesEndpoint {
private
List
<
CacheEntry
>
getCacheEntries
(
Predicate
<
String
>
cacheNamePredicate
,
Predicate
<
String
>
cacheManagerNamePredicate
)
{
List
<
CacheEntry
>
entries
=
new
ArrayList
<>();
this
.
cacheManagers
.
keySet
().
stream
().
filter
(
cacheManagerNamePredicate
)
.
forEach
((
cacheManagerName
)
->
entries
.
addAll
(
getCacheEntries
(
cacheManagerName
,
cacheNamePredicate
)));
return
entries
;
return
this
.
cacheManagers
.
keySet
().
stream
().
filter
(
cacheManagerNamePredicate
)
.
flatMap
((
cacheManagerName
)
->
getCacheEntries
(
cacheManagerName
,
cacheNamePredicate
).
stream
())
.
collect
(
Collectors
.
toList
());
}
private
List
<
CacheEntry
>
getCacheEntries
(
String
cacheManagerName
,
Predicate
<
String
>
cacheNamePredicate
)
{
CacheManager
cacheManager
=
this
.
cacheManagers
.
get
(
cacheManagerName
);
List
<
CacheEntry
>
entries
=
new
ArrayList
<>();
cacheManager
.
getCacheNames
().
stream
().
filter
(
cacheNamePredicate
)
return
cacheManager
.
getCacheNames
().
stream
().
filter
(
cacheNamePredicate
)
.
map
(
cacheManager:
:
getCache
).
filter
(
Objects:
:
nonNull
)
.
forEach
((
cache
)
->
entries
.
add
(
new
CacheEntry
(
cache
,
cacheManagerName
)));
return
entries
;
.
map
((
cache
)
->
new
CacheEntry
(
cache
,
cacheManagerName
))
.
collect
(
Collectors
.
toList
())
;
}
private
CacheEntry
extractUniqueCacheEntry
(
String
cache
,
List
<
CacheEntry
>
entries
)
{
...
...
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