Skip to content

Commit

Permalink
Add LinkTypeProvider#getLinkTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
bivashy committed Jul 10, 2023
1 parent 14f1830 commit 077cbce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.bivashy.auth.api.provider;

import java.util.Collection;
import java.util.Optional;

import com.bivashy.auth.api.link.LinkType;
Expand All @@ -10,4 +11,6 @@ public interface LinkTypeProvider {
void putLinkType(String linkName, LinkType linkType);

Optional<LinkType> getLinkType(String name);

Collection<LinkType> getLinkTypes();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.mastercapexd.auth.link;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -36,4 +37,9 @@ public void putLinkType(String name, LinkType linkType) {
public Optional<LinkType> getLinkType(String name) {
return Optional.ofNullable(linkTypeMap.getOrDefault(name, null));
}

@Override
public Collection<LinkType> getLinkTypes() {
return linkTypeMap.values();
}
}

0 comments on commit 077cbce

Please sign in to comment.