Class UserInputs
-
- All Implemented Interfaces:
-
java.io.Serializable,java.lang.Cloneable,java.util.Map
public class UserInputs extends HashMap<K, V>User Input contains a list of each provider and the providers ProviderInput As each provider requires input, the loader will pass its ProviderInput data.
-
-
Field Summary
Fields Modifier and Type Field Description public final static Array<ProviderIdentifier>defaultExcludedProviders
-
Constructor Summary
Constructors Constructor Description UserInputs()Constructs an empty UserInputs object.
-
Method Summary
Modifier and Type Method Description static UserInputsparseJson(@Nullable() String userInputsJson)Parse a JSON string into a UserInputs object. static UserInputsparseJson(@Nullable() String userInputsJson, @NonNull() Array<ProviderIdentifier> knownProviders)Parse a JSON string into a UserInputs object. static UserInputsparseJson(@Nullable() String userInputsJson, @NonNull() Array<ProviderIdentifier> knownProviders, @NonNull() Array<ProviderIdentifier> excludedProviders)Parse a JSON string into a UserInputs object excluding any providers present in the excludedProviders list. voidaddProvider(@NonNull() ProviderIdentifier providerId, @Nullable() ProviderInputs providerInputs)Adds the specified ProviderInputs for the specified provider to this UserInputs object. ProviderInputsgetInputs(@NonNull() ProviderIdentifier providerId)Retrieves the ProviderInputs corresponding to the specified provider from this UserInputs object. -
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values -
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString -
Methods inherited from class java.util.Map
copyOf, entry, of, ofEntries -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
parseJson
@NonNull() static UserInputs parseJson(@Nullable() String userInputsJson)
Parse a JSON string into a UserInputs object. Inputs for the JsonProvider will be ignored because they are not secure. Inputs for custom providers will also be ignored.
- Parameters:
userInputsJson- A JSON string that can be parsed into the desired UserInputs object.- Returns:
A UserInputs object the represents the supplied JSON string excluding the JsonProvider if present.
-
parseJson
@NonNull() static UserInputs parseJson(@Nullable() String userInputsJson, @NonNull() Array<ProviderIdentifier> knownProviders)
Parse a JSON string into a UserInputs object. Inputs for the JsonProvider will be ignored because they are not secure.
- Parameters:
userInputsJson- A JSON string that can be parsed into the desired UserInputs object.knownProviders- An array of ProviderIdentifier objects which specify all of the existing configuration providers including custom providers.- Returns:
A UserInputs object the represents the supplied JSON string excluding the JsonProvider if present.
-
parseJson
@NonNull() static UserInputs parseJson(@Nullable() String userInputsJson, @NonNull() Array<ProviderIdentifier> knownProviders, @NonNull() Array<ProviderIdentifier> excludedProviders)
Parse a JSON string into a UserInputs object excluding any providers present in the excludedProviders list. It is recommended that the JsonProvider be excluded because it can be insecure if exposed to the outside world.
- Parameters:
userInputsJson- A JSON string that can be parsed into the desired UserInputs object.knownProviders- An array of ProviderIdentifier objects which specify all of the existing configuration providers including custom providers.excludedProviders- An array of ProviderIdentifier objects, which indicate corresponding ProviderInputs object to be excluded from the resulting UserInput object.- Returns:
A UserInputs object the represents the supplied JSON string excluding any providers present in the excludedProviders array.
-
addProvider
void addProvider(@NonNull() ProviderIdentifier providerId, @Nullable() ProviderInputs providerInputs)
Adds the specified ProviderInputs for the specified provider to this UserInputs object.
- Parameters:
providerId- The provider identifier of the provider for which these inputs apply.providerInputs- A ProviderInputs object containing the User supplied inputs for this provider.
-
getInputs
@Nullable() ProviderInputs getInputs(@NonNull() ProviderIdentifier providerId)
Retrieves the ProviderInputs corresponding to the specified provider from this UserInputs object.
- Parameters:
providerId- The provider identifier of the provider for which the inputs are requested.- Returns:
A ProviderInputs object containing the User supplied inputs for the specified provider.
-
-
-
-