From f333d9ec29dde559ecefc239e3f03ef57da08bdc Mon Sep 17 00:00:00 2001 From: Flossy Date: Tue, 3 Sep 2024 11:48:08 -0400 Subject: [PATCH] Resolves #15 - CredentialsUtil is able to create Credentials from String params --- .../solenopsis/session/credentials/CredentialsUtil.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/solenopsis/session/credentials/CredentialsUtil.java b/src/main/java/org/solenopsis/session/credentials/CredentialsUtil.java index bb7cbcc..829fa4f 100644 --- a/src/main/java/org/solenopsis/session/credentials/CredentialsUtil.java +++ b/src/main/java/org/solenopsis/session/credentials/CredentialsUtil.java @@ -20,7 +20,6 @@ public final class CredentialsUtil { */ private static final Logger LOGGER = Logger.getLogger(CredentialsUtil.class.getName()); - /** * Return the logger. * @@ -33,10 +32,14 @@ static Logger getLogger() { private CredentialsUtil() { } + public static Credentials fromValues(final String url, final String username, final String password, final String token, final String version) { + return new CredentialsRecord(url, username, password, token, version); + } + public static Credentials fromProperties(final Properties properties) { Objects.requireNonNull(properties, "Null properties not allowed!"); - return new CredentialsRecord( + return fromValues( PropertiesCredentialsEnum.URL.getValue(properties), PropertiesCredentialsEnum.USERNAME.getValue(properties), PropertiesCredentialsEnum.PASSWORD.getValue(properties),