Interface ParameterFactory

  • All Known Implementing Classes:
    ParameterFactoryImpl

    public interface ParameterFactory
    Factory for Parameter interface
    Since:
    7.0
    Author:
    Eugene Petrenko (eugene.petrenko@gmail.com) Date: 08.09.11 18:48
    • Method Detail

      • createSimpleParameter

        @NotNull
        Parameter createSimpleParameter​(@NotNull
                                        String name,
                                        @NotNull
                                        String value)
      • createTypedParameter

        @NotNull
        Parameter createTypedParameter​(@NotNull
                                       String name,
                                       @NotNull
                                       String value,
                                       @NotNull
                                       String descriptionSpec)
      • createParameterWithNewName

        @NotNull
        Parameter createParameterWithNewName​(@NotNull
                                             Parameter parameter,
                                             @NotNull
                                             String name)
        Creates a copy of provided parameter with new name
        Parameters:
        parameter - original parameter
        name - new name
        Returns:
        copy of parameter with new name
        Since:
        9.0
      • mergeParameters

        Parameter mergeParameters​(@Nullable
                                  Parameter baseParameter,
                                  @NotNull
                                  Parameter childParameter)
        Merges 2 parameters
        Parameters:
        baseParameter -
        childParameter -
        Returns:
        1. If there is no base Parameter - child Parameter is returned 2. If base Parameter has Const spec - base Parameter is returned 3. If child value is not compliant with base spec - base Parameter is returned 4. A new Parameter instance with base spec and child value is returned otherwise
      • merge

        @NotNull
        <ObjectType> ObjectType merge​(@Nullable
                                      ControlDescription baseCD,
                                      @Nullable
                                      ObjectType base,
                                      @NotNull
                                      ObjectType child,
                                      @NotNull
                                      Function<ObjectType,​String> toStringFunction,
                                      @NotNull
                                      BiFunction<ObjectType,​ObjectType,​ObjectType> mergingFunction)
      • createOverriddenParameter

        @NotNull
        Parameter createOverriddenParameter​(@NotNull
                                            Parameter baseParameter,
                                            @NotNull
                                            Parameter childParameter)
        Creates an instance of parameter that overrides a parameter from parent
        Parameters:
        baseParameter - base parameter to be overridden
        childParameter - child parameter to be used
        Returns:
        new instance of parameter
      • deserializeDBParameter

        @NotNull
        Parameter deserializeDBParameter​(@NotNull
                                         String name,
                                         @NotNull
                                         String value)
      • getRawValues

        @NotNull
        Map<String,​String> getRawValues​(@NotNull
                                              Collection<Parameter> parameters)
        Accepts collection of parameters, returns map from parameter name to its raw value. Results are unpredictable if collection of parameters contains two parameters with the same name.
        Parameters:
        parameters - parameters collection
        Returns:
        map from name to parameter raw value
        Since:
        10.0
      • getRawValue

        @NotNull
        String getRawValue​(@NotNull
                           Parameter parameter)
        For given parameter returns its raw value.
        Parameters:
        parameter - parameter
        Returns:
        raw value of given parameter
        Since:
        10.0
      • isSecureParameter

        boolean isSecureParameter​(@Nullable
                                  ControlDescription cd)
        Parameters:
        cd - parameter specification, if null then this method always returns false
        Returns:
        true if parameter specification corresponds to secure parameter
        Since:
        2017.1