From 077cbce547af09a1784b7b7ae42f54fd1cb2596b Mon Sep 17 00:00:00 2001 From: bivashy Date: Tue, 11 Jul 2023 01:10:44 +0600 Subject: [PATCH] Add LinkTypeProvider#getLinkTypes --- .../com/bivashy/auth/api/provider/LinkTypeProvider.java | 3 +++ .../me/mastercapexd/auth/link/BaseLinkTypeProvider.java | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/api/src/main/java/com/bivashy/auth/api/provider/LinkTypeProvider.java b/api/src/main/java/com/bivashy/auth/api/provider/LinkTypeProvider.java index fcfdf1aa..5c6e9721 100644 --- a/api/src/main/java/com/bivashy/auth/api/provider/LinkTypeProvider.java +++ b/api/src/main/java/com/bivashy/auth/api/provider/LinkTypeProvider.java @@ -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; @@ -10,4 +11,6 @@ public interface LinkTypeProvider { void putLinkType(String linkName, LinkType linkType); Optional getLinkType(String name); + + Collection getLinkTypes(); } diff --git a/core/src/main/java/me/mastercapexd/auth/link/BaseLinkTypeProvider.java b/core/src/main/java/me/mastercapexd/auth/link/BaseLinkTypeProvider.java index bb3f6db9..2d1e3081 100644 --- a/core/src/main/java/me/mastercapexd/auth/link/BaseLinkTypeProvider.java +++ b/core/src/main/java/me/mastercapexd/auth/link/BaseLinkTypeProvider.java @@ -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; @@ -36,4 +37,9 @@ public void putLinkType(String name, LinkType linkType) { public Optional getLinkType(String name) { return Optional.ofNullable(linkTypeMap.getOrDefault(name, null)); } + + @Override + public Collection getLinkTypes() { + return linkTypeMap.values(); + } }