org.thewonderlemming.c4plantuml.linter.rules

## Class RuleParameters

- java.lang.Object
- - org.thewonderlemming.c4plantuml.linter.rules.RuleParameters

-     public class RuleParameters
      extends Object

  A container for settings to control the behavior of a `AbstractLintingRule`.
  Author:
    thewonderlemming

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `RuleParameters.AddParameter` A part of the `RuleParameters` builder.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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>`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### builder

          public static RuleParameters.AddParameter builder()

      Returns a fluent builder instance to the `RuleParameters` class.
      Returns:
        a new builder instance for `RuleParameters`.

    - #### getParameter

          public Optional<String> getParameter(String parameterName)

      Retrieves a parameter value by its name.
      Parameters:
        `parameterName` - the name of the parameter to retrieve value from.
      Returns:
        an `Optional` of the value if found, or empty else.

    - #### getParameterAsBoolean

          public Optional<Boolean> getParameterAsBoolean(String parameterName)

      Retrieves a `Boolean` parameter value by its name.
      Parameters:
        `parameterName` - parameterName the name of the parameter to retrieve value from.
      Returns:
        an `Optional` of the value if found, or empty else.

    - #### getParameterAsInteger

          public Optional<Integer> getParameterAsInteger(String parameterName)

      Retrieves an `Integer` parameter value by its name.
      Parameters:
        `parameterName` - parameterName the name of the parameter to retrieve value from.
      Returns:
        an `Optional` of the value if found, or empty else.

    - #### getParameterAsLong

          public Optional<Long> getParameterAsLong(String parameterName)

      Retrieves a `Long` parameter value by its name.
      Parameters:
        `parameterName` - parameterName the name of the parameter to retrieve value from.
      Returns:
        an `Optional` of the value if found, or empty else.

    - #### getParameterAsType

          public <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>`.
      Type Parameters:
        `T` - the type to which you want to cast the value.
      Parameters:
        `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.
      Returns:
        an `Optional` of the value if found, or empty else.

Copyright © 2020. All rights reserved.