Packages

c

com.microsoft.azure.synapse.ml.core.utils

ParamsStringBuilder

class ParamsStringBuilder extends AnyRef

Helper class for converting individual typed parameters to a single long string for passing to native libraries.

Example: new ParamsStringBuilder(prefix = "--", delimiter = "=") .append("--first_param=a") .appendParamValueIfNotThere("first_param", Option("a2")) .appendParamValueIfNotThere("second_param", Option("b")) .appendParamValueIfNotThere("third_param", None) .result

result == "--first_param=a --second_param=b"

This utility mimics a traditional StringBuilder, where you append parts and ask for the final result() at the end. Each parameter appended is tracked and can be compared against the current string, to both avoid duplicates and provide an override mechanism. The first param added is considered the primary one to not be replaced.

Use 'append' to add an unchecked string directly to end of current string.

Use ParamsSet to create encapsulated subsets of params that can be incorporated into the parent ParamsStringBuilder.

There is also integration with the SparkML Params system. Construct with a parent Params object and use the methods with Param arguments.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ParamsStringBuilder
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ParamsStringBuilder(parent: Params, prefix: String, delimiter: String)
  2. new ParamsStringBuilder(prefix: String = "", delimiter: String = "=")
  3. new ParamsStringBuilder(parent: Option[Params], prefix: String, delimiter: String)

    parent

    Optional parent Params instance to validate each Param against.

    prefix

    Optional prefix to put before parameter names (e.g. "--"). Defaults to none.

    delimiter

    Optional delimiter to put between names and values (e.g. "="). Defaults to "=".

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def append(str: String): ParamsStringBuilder

    Direct append a string with no checking of existing params.

    Direct append a string with no checking of existing params.

    str

    The string to add.

  5. def appendParamFlagIfNotThere(name: String): ParamsStringBuilder

    Add a parameter name to the end of the current string.

    Add a parameter name to the end of the current string. (i.e. a param that does not have a value)

  6. def appendParamGroup(paramGroup: ParamGroup, condition: Boolean): ParamsStringBuilder

    Add a parameter group to the end of the current string conditionally.

    Add a parameter group to the end of the current string conditionally.

    paramGroup

    The ParamGroup to add.

    condition

    Whether to add the group or not.

  7. def appendParamGroup(paramGroup: ParamGroup): ParamsStringBuilder

    Add a parameter group to the end of the current string.

    Add a parameter group to the end of the current string.

    paramGroup

    The ParamGroup to add.

  8. def appendParamList[T](name: String, values: Array[T]): ParamsStringBuilder
  9. def appendParamListIfNotThere[T](name: String, values: Array[T]): ParamsStringBuilder

    Add a parameter name-list pair to the end of the current string.

    Add a parameter name-list pair to the end of the current string. Values will be comma-delimited.

    values

    The Array of values. Note that if the array is empty, nothing will be appended to string.

  10. def appendParamValueIfNotThere[T](optionLong: String, param: Option[T]): ParamsStringBuilder

    Add a parameter name-value pair to the end of the current string.

    Add a parameter name-value pair to the end of the current string.

    optionLong

    Long name of the parameter. Will be used if it is not already set.

    param

    The Option object with the value. Note that if this is None, nothing will be appended to string.

  11. def appendParamValueIfNotThere[T](optionShort: String, optionLong: String, param: Param[T]): ParamsStringBuilder

    Add a parameter name-value pair to the end of the current string.

    Add a parameter name-value pair to the end of the current string.

    optionShort

    Short name of the parameter (only used to check against existing params).

    optionLong

    Long name of the parameter. Will be used if it is not already set.

    param

    The Param object with the value. Note that if this is not set, nothing will be appended to string.

  12. def appendRepeatableParamIfNotThere[T](optionShort: String, optionLong: String, values: Array[T]): ParamsStringBuilder

    Add a parameter that can be repeated, once for each element in the array (e.g.

    Add a parameter that can be repeated, once for each element in the array (e.g. "-q aa -q bb")

    optionLong

    Long name of the parameter. Will be used if it is not already set.

    values

    The Array of values. Note that if the array is empty, nothing will be appended to string.

  13. def appendRepeatableParamIfNotThere[T](optionShort: String, optionLong: String, param: Param[T]): ParamsStringBuilder

    Add a parameter name-value pair for each array element to the end of the current string (e.g.

    Add a parameter name-value pair for each array element to the end of the current string (e.g. "-q aa -q bb").

    optionShort

    Short name of the parameter (only used to check against existing params).

    optionLong

    Long name of the parameter. Will be used if it is not already set.

    param

    The Param object with the value. Note that if this is not set, nothing will be appended to string.

  14. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. def result(): String
  26. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  27. def toString(): String
    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped