public final class ConfigurationHelper
extends java.lang.Object
ParameterStructure| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
UNKNOWN_VALUE |
static java.lang.String |
UNSPECIFIED_VALUE |
| Modifier and Type | Method and Description |
|---|---|
static <T> Parameter<T> |
buildSimpleMultiValuedParam(java.lang.String param,
java.util.Collection<T> values) |
static <T> Parameter<T> |
buildSimpleParam(java.lang.String param,
T value) |
static <T> java.util.Collection<T> |
getMandatoryMultivaluedParameter(java.lang.String paramName,
ParameterStructure parameters) |
static boolean |
getMandatoryParameterAsBoolean(java.lang.String paramName,
ParameterStructure parameters) |
static byte[] |
getMandatoryParameterAsByteArray(java.lang.String paramName,
ParameterStructure parameters) |
static int |
getMandatoryParameterAsInt(java.lang.String paramName,
ParameterStructure parameters) |
static long |
getMandatoryParameterAsLong(java.lang.String paramName,
ParameterStructure parameters) |
static java.lang.String |
getMandatoryParameterAsString(java.lang.String paramName,
ParameterStructure parameters) |
static <T> java.util.Collection<T> |
getOptionalMultivaluedParameter(java.lang.String paramName,
ParameterStructure parameters) |
static boolean |
getOptionalParameterAsBoolean(java.lang.String paramName,
boolean defaultValue,
ParameterStructure parameters) |
static java.lang.Boolean |
getOptionalParameterAsBoolean(java.lang.String paramName,
java.lang.Boolean defaultValue,
ParameterStructure parameters) |
static byte |
getOptionalParameterAsByte(java.lang.String paramName,
byte defaultValue,
ParameterStructure parameters) |
static byte[] |
getOptionalParameterAsByteArray(java.lang.String paramName,
byte[] defaultValue,
ParameterStructure parameters) |
static char |
getOptionalParameterAsChar(java.lang.String paramName,
char defaultValue,
ParameterStructure parameters) |
static int |
getOptionalParameterAsInt(java.lang.String paramName,
int defaultValue,
ParameterStructure parameters) |
static long |
getOptionalParameterAsLong(java.lang.String paramName,
long defaultValue,
ParameterStructure parameters) |
static float |
getOptionalParameterAsNonNegativeFloat(java.lang.String paramName,
float defaultValue,
ParameterStructure parameters) |
static int |
getOptionalParameterAsNonNegativeInt(java.lang.String paramName,
int defaultValue,
ParameterStructure parameters) |
static long |
getOptionalParameterAsNonNegativeLong(java.lang.String paramName,
long defaultValue,
ParameterStructure parameters) |
static int |
getOptionalParameterAsPositiveInt(java.lang.String paramName,
int defaultValue,
ParameterStructure parameters) |
static java.lang.String |
getOptionalParameterAsString(java.lang.String paramName,
java.lang.String defaultValue,
ParameterStructure parameters) |
static <T> java.util.Collection<T> |
getValues(ParameterStructure params,
java.lang.String pathExpressions)
Obtains the values of the parameters indicated in the pathExpression.
|
static boolean |
isParamEncrypted(ParameterStructure parameters,
java.lang.String parameterName) |
static void |
postProcessConfiguration(Configuration config) |
static void |
postProcessConfiguration(Configuration config,
boolean legacy) |
static void |
replaceAll(ParameterStructure params,
java.lang.String pathExpressions,
java.util.Map<java.lang.String,?> paramValues)
Replaces each value of the parameters indicated in the pathExpression
with the given replacement in the map provided.
|
static void |
replaceAll(ParameterStructure params,
java.lang.String pathExpressions,
java.util.Map<java.lang.String,?> paramValues,
boolean keepCurrentIfNoReplacement) |
static void |
replaceAll(ParameterStructure params,
java.lang.String pathExpressions,
java.util.function.UnaryOperator<java.lang.String> getElementName) |
static java.util.Collection<java.lang.String> |
replaceAllWithWarnings(ParameterStructure params,
java.lang.String pathExpressions,
java.util.Map<java.lang.String,?> paramValues) |
static java.util.Collection<java.lang.String> |
replaceAllWithWarnings(ParameterStructure params,
java.lang.String pathExpressions,
java.util.Map<java.lang.String,?> paramValues,
boolean keepCurrentIfNoReplacement) |
static java.util.Collection<java.lang.String> |
replaceAllWithWarnings(ParameterStructure params,
java.lang.String pathExpressions,
java.util.function.UnaryOperator<java.lang.String> getElementName) |
public static final java.lang.String UNSPECIFIED_VALUE
public static final java.lang.String UNKNOWN_VALUE
public static java.lang.String getMandatoryParameterAsString(java.lang.String paramName,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static java.lang.String getOptionalParameterAsString(java.lang.String paramName,
java.lang.String defaultValue,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static char getOptionalParameterAsChar(java.lang.String paramName,
char defaultValue,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static int getMandatoryParameterAsInt(java.lang.String paramName,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static int getOptionalParameterAsNonNegativeInt(java.lang.String paramName,
int defaultValue,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static int getOptionalParameterAsPositiveInt(java.lang.String paramName,
int defaultValue,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static int getOptionalParameterAsInt(java.lang.String paramName,
int defaultValue,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static byte getOptionalParameterAsByte(java.lang.String paramName,
byte defaultValue,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static long getMandatoryParameterAsLong(java.lang.String paramName,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static long getOptionalParameterAsNonNegativeLong(java.lang.String paramName,
long defaultValue,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static long getOptionalParameterAsLong(java.lang.String paramName,
long defaultValue,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static float getOptionalParameterAsNonNegativeFloat(java.lang.String paramName,
float defaultValue,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static boolean getMandatoryParameterAsBoolean(java.lang.String paramName,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static boolean getOptionalParameterAsBoolean(java.lang.String paramName,
boolean defaultValue,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static java.lang.Boolean getOptionalParameterAsBoolean(java.lang.String paramName,
java.lang.Boolean defaultValue,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static byte[] getMandatoryParameterAsByteArray(java.lang.String paramName,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static byte[] getOptionalParameterAsByteArray(java.lang.String paramName,
byte[] defaultValue,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static <T> java.util.Collection<T> getMandatoryMultivaluedParameter(java.lang.String paramName,
ParameterStructure parameters)
throws ConfigurationException
ConfigurationExceptionpublic static <T> java.util.Collection<T> getOptionalMultivaluedParameter(java.lang.String paramName,
ParameterStructure parameters)
public static void replaceAll(ParameterStructure params, java.lang.String pathExpressions, java.util.Map<java.lang.String,?> paramValues)
params - pathExpressions - A path expression describes the location of
a Parameter in the ParameterStructure. By starting at the root
parameter, select any parameter creating a chain of
children parameters. The last parameter of the expression should
be a SimpleParameter.Each parameter is separated by "::".
Each path expression is separated by ",".
For example: for replacing the values of parameters dataSource
and filterSequenceID the path expression should be:
"dataSource,processor::filterSequenceID".paramValues - Map containing the replacements for the parameter
values. The key of the Map is parameter value to be replaced.
The value of the Map is the replacement.public static void replaceAll(ParameterStructure params, java.lang.String pathExpressions, java.util.Map<java.lang.String,?> paramValues, boolean keepCurrentIfNoReplacement)
public static void replaceAll(ParameterStructure params, java.lang.String pathExpressions, java.util.function.UnaryOperator<java.lang.String> getElementName)
public static java.util.Collection<java.lang.String> replaceAllWithWarnings(ParameterStructure params, java.lang.String pathExpressions, java.util.function.UnaryOperator<java.lang.String> getElementName)
public static java.util.Collection<java.lang.String> replaceAllWithWarnings(ParameterStructure params, java.lang.String pathExpressions, java.util.Map<java.lang.String,?> paramValues)
public static java.util.Collection<java.lang.String> replaceAllWithWarnings(ParameterStructure params, java.lang.String pathExpressions, java.util.Map<java.lang.String,?> paramValues, boolean keepCurrentIfNoReplacement)
public static <T> java.util.Collection<T> getValues(ParameterStructure params, java.lang.String pathExpressions)
T - params - pathExpressions - A path expression describes the location of
a Parameter in the ParameterStructure. By starting at the root
parameter, select any parameter creating a chain of
children parameters. The last parameter of the expression should
be a SimpleParameter. Each parameter is separated by "::".
Each path expression is separated by ",".
For example: for obtaining the values of parameters type of
crawler and type of exporter the path expression should be:
"crawler::type,processor::exporter::type".public static boolean isParamEncrypted(ParameterStructure parameters, java.lang.String parameterName) throws ConfigurationException
ConfigurationExceptionpublic static <T> Parameter<T> buildSimpleParam(java.lang.String param, T value)
public static <T> Parameter<T> buildSimpleMultiValuedParam(java.lang.String param, java.util.Collection<T> values)
public static void postProcessConfiguration(Configuration config) throws ConfigurationException, InstanceNotFoundException, DuplicateInstanceException, InternalErrorException
public static void postProcessConfiguration(Configuration config, boolean legacy) throws ConfigurationException, InstanceNotFoundException, DuplicateInstanceException, InternalErrorException
Copyright © 2024 Denodo Technologies. All rights reserved.