public class RuleParameters extends Object
AbstractLintingRule.| Modifier and Type | Class and Description |
|---|---|
static interface |
RuleParameters.AddParameter
A part of the
RuleParameters builder. |
| Modifier and Type | Method and Description |
|---|---|
static RuleParameters.AddParameter |
builder()
Returns a fluent builder instance to the
RuleParameters class. |
Optional<String> |
getParameter(String parameterName)
Retrieves a parameter value by its name.
|
Optional<Boolean> |
getParameterAsBoolean(String parameterName)
Retrieves a
Boolean parameter value by its name. |
Optional<Integer> |
getParameterAsInteger(String parameterName)
Retrieves an
Integer parameter value by its name. |
Optional<Long> |
getParameterAsLong(String parameterName)
Retrieves a
Long parameter value by its name. |
<T> Optional<T> |
getParameterAsType(String parameterName,
Class<T> typeClass,
Function<String,Optional<T>> typeConverter)
Retrieves a parameter value by its name and casts it to the given type
<T>. |
public static RuleParameters.AddParameter builder()
RuleParameters class.RuleParameters.public Optional<String> getParameter(String parameterName)
parameterName - the name of the parameter to retrieve value from.Optional of the value if found, or empty else.public Optional<Boolean> getParameterAsBoolean(String parameterName)
Boolean parameter value by its name.parameterName - parameterName the name of the parameter to retrieve value from.Optional of the value if found, or empty else.public Optional<Integer> getParameterAsInteger(String parameterName)
Integer parameter value by its name.parameterName - parameterName the name of the parameter to retrieve value from.Optional of the value if found, or empty else.public Optional<Long> getParameterAsLong(String parameterName)
Long parameter value by its name.parameterName - parameterName the name of the parameter to retrieve value from.Optional of the value if found, or empty else.public <T> Optional<T> getParameterAsType(String parameterName, Class<T> typeClass, Function<String,Optional<T>> typeConverter)
<T>.T - the type to which you want to cast the value.parameterName - parameterName the name of the parameter to retrieve value from.typeClass - the type to which you want to cast the value to.typeConverter - the converter function used to cast the parameter value.Optional of the value if found, or empty else.Copyright © 2020. All rights reserved.