Skip to content

Any

The common superclass of all classes.

Stub code in coreClasses.sdsstub
class Any {

    /**
     * Return whether the object is truthy.
     *
     * @example
     * pipeline example {
     *     val boolean = 1.toBoolean(); // true
     * }
     *
     * @example
     * pipeline example {
     *     val boolean = 0.toBoolean(); // false
     * }
     */
    @Pure
    @PythonMacro("bool($this)")
    fun toBoolean() -> boolean: Boolean

    /**
     * Return a string representation of the object.
     *
     * @example
     * pipeline example {
     *     val string = 1.toString(); // "1"
     * }
     */
    @Pure
    @PythonMacro("str($this)")
    fun toString() -> string: String
}

toBoolean

Return whether the object is truthy.

Results:

Name Type Description
boolean Boolean -

Examples:

pipeline example {
    val boolean = 1.toBoolean(); // true
}
pipeline example {
    val boolean = 0.toBoolean(); // false
}

Stub code in coreClasses.sdsstub
@Pure
@PythonMacro("bool($this)")
fun toBoolean() -> boolean: Boolean

toString

Return a string representation of the object.

Results:

Name Type Description
string String -

Examples:

pipeline example {
    val string = 1.toString(); // "1"
}
Stub code in coreClasses.sdsstub
@Pure
@PythonMacro("str($this)")
fun toString() -> string: String