File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/main/java/com/contentgrid/hateoas/client/hal Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -51,20 +51,20 @@ public HalLink getSelfLink() {
5151 }
5252
5353 public Optional <HalLink > getLink (@ NonNull String rel , @ NonNull String name ) {
54- return getLinks (rel ).flatMap (links -> links .stream ()
54+ return getLinks (rel ).flatMap (linksForRel -> linksForRel .stream ()
5555 .filter (link -> Objects .equals (name , link .getName ()))
5656 .findFirst ());
5757 }
5858
5959 public Optional <HalLink > getLink (@ NonNull String rel ) {
6060 return Optional .ofNullable (this .links .get (rel ))
61- .flatMap (links -> {
62- if (links .isEmpty ()) {
61+ .flatMap (linksForRel -> {
62+ if (linksForRel .isEmpty ()) {
6363 return Optional .empty ();
64- } else if (links .size () == 1 ) {
65- return links .stream ().findFirst ();
64+ } else if (linksForRel .size () == 1 ) {
65+ return linksForRel .stream ().findFirst ();
6666 }
67- throw new RuntimeException ("Expected 1 link, but has %s links" .formatted (links .size ()));
67+ throw new RuntimeException ("Expected 1 link, but has %s links" .formatted (linksForRel .size ()));
6868 });
6969 }
7070
You can’t perform that action at this time.
0 commit comments