Clean up TokenAuthenticators 33/100933/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 3 May 2022 08:48:16 +0000 (10:48 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 3 May 2022 08:53:06 +0000 (10:53 +0200)
Make the class final and use a List instead of a plain collection.

Change-Id: Ibb1fc1c6b536ebd8138560c27296d8b1f7248f27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/TokenAuthenticators.java

index 6cf409ebee61bb5221e142c0645841fb91edf284..03aeba1bb87044eed57ec18f90cd267c462f45f7 100644 (file)
@@ -7,8 +7,7 @@
  */
 package org.opendaylight.aaa.tokenauthrealm.auth;
 
-import com.google.common.collect.ImmutableList;
-import java.util.Collection;
+import java.util.List;
 import org.opendaylight.aaa.api.TokenAuth;
 
 /**
@@ -16,14 +15,14 @@ import org.opendaylight.aaa.api.TokenAuth;
  *
  * @author Thomas Pantelis
  */
-public class TokenAuthenticators {
-    private final Collection<TokenAuth> tokenAuthCollection;
+public final class TokenAuthenticators {
+    private final List<TokenAuth> tokenAuthCollection;
 
     public TokenAuthenticators(TokenAuth... tokenAuths) {
-        tokenAuthCollection = new ImmutableList.Builder<TokenAuth>().add(tokenAuths).build();
+        tokenAuthCollection = List.of(tokenAuths);
     }
 
-    public Collection<TokenAuth> getTokenAuthCollection() {
+    public List<TokenAuth> getTokenAuthCollection() {
         return tokenAuthCollection;
     }
 }