coldbox.system

Class FrameworkSupertype

lucee.Component
    extended by coldbox.system.FrameworkSupertype
Direct Known Subclasses:
EventHandler , Interceptor , HTMLHelper , Renderer , Router

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- Base class for all things Box

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • serializable : false
  •  
  • author : Luis Majano
  •  
    Property Summary
    type property default serializable required
    any controller
          App Controller.

    • access = public
    • returntype = any
    true false
    Method Summary
    string addAsset(any asset)
         Add a js/css asset(s) to the html head section.
    any announce(any state, [struct data='[runtime expression]'], [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllJoin='true'], [any asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'])
         Announce an interception.
    any announceInterception(any state, [struct interceptData='[runtime expression]'], [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllJoin='true'], [any asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'])
    any async()
         Return the ColdBox Async Manager instance so you can do some async or parallel programming.
    any externalView(any view, [struct args='[runtime expression]'], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'])
         Renders an external view anywhere that cfinclude works.
    any forAttribute(any data)
         This function allows you to serialize simple or complex data so it can be used within HTML Attributes.
    any getCache([any name='default'])
         Get a named CacheBox Cache.
    any getColdBoxSetting(any name, [any defaultValue])
         Get a ColdBox setting.
    string getController()
    any getEnv(any key, [any defaultValue])
         Retrieve a environment variable only.
    any getInstance([any name], [struct initArguments='[runtime expression]'], [any dsl], [any targetObject=''], [any injector])
         Locates, Creates, Injects and Configures an object model instance.
    any getInterceptor(any interceptorName)
         Get an interceptor reference.
    any getModel()
    struct getModuleConfig(any module)
         Get a module's configuration structure.
    any getModuleSettings(any module, [any setting], [any defaultValue])
         Get a module's settings structure or a specific setting if the setting key is passed.
    any getRenderer()
         Retrieve the system web renderer.
    struct getRequestCollection([boolean private='false'])
         Get the RC or PRC collection reference.
    any getRequestContext()
         Retrieve the request context object.
    any getSetting(any name, [any defaultValue])
         Get a setting from the system.
    any getSystemProperty(any key, [any defaultValue])
         Retrieve a Java System property only!.
    any getSystemSetting(any key, [any defaultValue])
         Retrieve a Java System property or env value by name.
    any includeUDF(any udflibrary)
         Injects a UDF Library (*.
    any layout([any layout], [any module=''], [any view=''], [struct args='[runtime expression]'], [any viewModule=''], [boolean prePostExempt='false'])
         Render a layout or a layout + view combo.
    any listen(any target, any point)
         Register a closure listener as an interceptor on a specific point.
    any loadApplicationHelpers([boolean force='false'])
         Load the global application helper libraries defined in the applicationHelper Setting of your application.
    string locateDirectoryPath(any pathToCheck)
         Resolve a directory to be either relative or absolute in your application.
    string locateFilePath(any pathToCheck)
         Resolve a file to be either relative or absolute in your application.
    any persistVariables([any persist=''], [struct persistStruct='[runtime expression]'])
         Persist variables into the Flash RAM.
    any populateModel(any model, [any scope=''], [boolean trustedSetter='false'], [any include=''], [any exclude=''], [boolean ignoreEmpty='false'], [any nullEmptyInclude=''], [any nullEmptyExclude=''], [boolean composeRelationships='false'], [struct memento='[runtime expression]'], [string jsonstring], [string xml], [query qry])
         Populate a model object from the request Collection or a passed in memento structure.
    void relocate([any event], [any URL], [any URI], [any queryString], [any persist], [struct persistStruct], [boolean addToken], [boolean ssl], [any baseURL], [boolean postProcessExempt], [numeric statusCode])
         Relocate user browser requests to other events, URLs, or URIs.
    any renderExternalView(any view, [struct args='[runtime expression]'], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'])
         Renders an external view anywhere that cfinclude works.
    any renderLayout([any layout], [any module=''], [any view=''], [struct args='[runtime expression]'], [any viewModule=''], [boolean prePostExempt='false'])
         Render a layout or a layout + view combo.
    any renderView([any view=''], [struct args='[runtime expression]'], [any module=''], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'], [any collection], [any collectionAs=''], [numeric collectionStartRow='1'], [numeric collectionMaxRows='0'], [any collectionDelim=''], [boolean prePostExempt='false'], [any name])
         Render out a view.
    any runEvent([any event=''], [boolean prePostExempt='false'], [boolean private='false'], [boolean defaultEvent='false'], [struct eventArguments='[runtime expression]'], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'])
         Executes events with full life-cycle methods and returns the event results if any were returned.
    any runRoute(any name, [struct params='[runtime expression]'], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'], [boolean prePostExempt='false'])
         Executes internal named routes with or without parameters.
    any setController(any controller)
    any setSetting(any name, any value)
         Set a new setting in the system.
    boolean settingExists(any name)
         Check if the setting exists in the application.
    any view([any view=''], [struct args='[runtime expression]'], [any module=''], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'], [any collection], [any collectionAs=''], [numeric collectionStartRow='1'], [numeric collectionMaxRows='0'], [any collectionDelim=''], [boolean prePostExempt='false'], [any name])
         Render out a view.
    any when(boolean target, any success, [any failure])
         Functional construct for if statements.
     
    Methods inherited from class lucee.Component
    None

    Property Detail

    controller

    property any controller

    App Controller

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    addAsset

    public string addAsset(any asset)

    Add a js/css asset(s) to the html head section. You can also pass in a list of assets. This method keeps track of the loaded assets so they are only loaded once

    Parameters:
    asset - The asset(s) to load, only js or css files. This can also be a comma delimited list.

    announce

    public any announce(any state, [struct data='[runtime expression]'], [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllJoin='true'], [any asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'])

    Announce an interception

    Parameters:
    state - The interception state to announce
    data - A data structure used to pass intercepted information.
    async - If true, the entire interception chain will be ran in a separate thread.
    asyncAll - If true, each interceptor in the interception chain will be ran in a separate thread and then joined together at the end.
    asyncAllJoin - If true, each interceptor in the interception chain will be ran in a separate thread and joined together at the end by default. If you set this flag to false then there will be no joining and waiting for the threads to finalize.
    asyncPriority - The thread priority to be used. Either LOW, NORMAL or HIGH. The default value is NORMAL
    asyncJoinTimeout - The timeout in milliseconds for the join thread to wait for interceptor threads to finish. By default there is no timeout.
    Returns:
    struct of thread information or void

    announceInterception Deprecated

    public any announceInterception(any state, [struct interceptData='[runtime expression]'], [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllJoin='true'], [any asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'])

    Deprecated:
    Please use the new `announce()` function
    Parameters:
    state
    interceptData
    async
    asyncAll
    asyncAllJoin
    asyncPriority
    asyncJoinTimeout

    async

    public any async()

    Return the ColdBox Async Manager instance so you can do some async or parallel programming

    Returns:
    coldbox.system.async.AsyncManager

    externalView

    public any externalView(any view, [struct args='[runtime expression]'], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'])

    Renders an external view anywhere that cfinclude works.

    Parameters:
    view - The the view to render
    args - A struct of arguments to pass into the view for rendering, will be available as 'args' in the view.
    cache - Cached the view output or not, defaults to false
    cacheTimeout - The time in minutes to cache the view
    cacheLastAccessTimeout - The time in minutes the view will be removed from cache if idle or requested
    cacheSuffix - The suffix to add into the cache entry for this view rendering
    cacheProvider - The provider to cache this view in, defaults to 'template'
    Returns:
    The rendered view

    forAttribute

    public any forAttribute(any data)

    This function allows you to serialize simple or complex data so it can be used within HTML Attributes.

    Parameters:
    data - The simple or complex data to bind to an HTML Attribute

    getCache

    public any getCache([any name='default'])

    Get a named CacheBox Cache

    Parameters:
    name - The name of the cache to retrieve, if not passed, it used the 'default' cache.
    Returns:
    coldbox.system.cache.providers.IColdBoxProvider

    getColdBoxSetting

    public any getColdBoxSetting(any name, [any defaultValue])

    Get a ColdBox setting

    Parameters:
    name - The key to get
    defaultValue - The default value if it doesn't exist
    Returns:
    The framework setting value
    Throws:
    SettingNotFoundException

    getController

    public string getController()


    getEnv

    public any getEnv(any key, [any defaultValue])

    Retrieve a environment variable only

    Parameters:
    key - The name of the setting to look up.
    defaultValue - The default value to use if the key does not exist in the system properties or the env

    getInstance

    public any getInstance([any name], [struct initArguments='[runtime expression]'], [any dsl], [any targetObject=''], [any injector])

    Locates, Creates, Injects and Configures an object model instance

    Parameters:
    name - The mapping name or CFC instance path to try to build up
    initArguments - The constructor structure of arguments to passthrough when initializing the instance
    dsl - The dsl string to use to retrieve the instance model object, mutually exclusive with 'name
    targetObject - The object requesting the dependency, usually only used by DSL lookups
    injector - The child injector to use when retrieving the instance
    Returns:
    The requested instance
    Throws:
    InvalidChildInjector - When you request an instance from an invalid child injector name

    getInterceptor

    public any getInterceptor(any interceptorName)

    Get an interceptor reference

    Parameters:
    interceptorName - The name of the interceptor to retrieve
    Returns:
    Interceptor

    getModel Deprecated

    public any getModel()

    Deprecated:
    true

    getModuleConfig

    public struct getModuleConfig(any module)

    Get a module's configuration structure

    Parameters:
    module - The module to retrieve the configuration structure from
    Returns:
    The struct requested
    Throws:
    InvalidModuleException - The module passed is invalid

    getModuleSettings

    public any getModuleSettings(any module, [any setting], [any defaultValue])

    Get a module's settings structure or a specific setting if the setting key is passed

    Parameters:
    module - The module to retrieve the configuration settings from
    setting - The setting to retrieve if passed
    defaultValue - The default value to return if setting does not exist
    Returns:
    struct or any

    getRenderer

    public any getRenderer()

    Retrieve the system web renderer

    Returns:
    coldbox.system.web.Renderer

    getRequestCollection

    public struct getRequestCollection([boolean private='false'])

    Get the RC or PRC collection reference

    Parameters:
    private - The boolean bit that says give me the RC by default or true for the private collection (PRC)
    Returns:
    The requeted collection

    getRequestContext

    public any getRequestContext()

    Retrieve the request context object

    Returns:
    coldbox.system.web.context.RequestContext

    getSetting

    public any getSetting(any name, [any defaultValue])

    Get a setting from the system

    Parameters:
    name - The key of the setting
    defaultValue - If not found in config, default return value
    Returns:
    The requested setting
    Throws:
    SettingNotFoundException

    getSystemProperty

    public any getSystemProperty(any key, [any defaultValue])

    Retrieve a Java System property only!

    Parameters:
    key - The name of the setting to look up.
    defaultValue - The default value to use if the key does not exist in the system properties or the env

    getSystemSetting

    public any getSystemSetting(any key, [any defaultValue])

    Retrieve a Java System property or env value by name. It looks at properties first then environment variables

    Parameters:
    key - The name of the setting to look up.
    defaultValue - The default value to use if the key does not exist in the system properties or the env

    includeUDF

    public any includeUDF(any udflibrary)

    Injects a UDF Library (*.cfc or *.cfm) into the target object. It does not however, put the mixins on any of the cfc scopes. Therefore they can only be called internally

    Parameters:
    udflibrary - The UDF library to inject
    Returns:
    FrameworkSuperType
    Throws:
    UDFLibraryNotFoundException - When the requested library cannot be found

    layout

    public any layout([any layout], [any module=''], [any view=''], [struct args='[runtime expression]'], [any viewModule=''], [boolean prePostExempt='false'])

    Render a layout or a layout + view combo

    Parameters:
    layout - The layout to render out
    module - The module to explicitly render this layout from
    view - The view to render within this layout
    args - An optional set of arguments that will be available to this layouts/view rendering ONLY
    viewModule - The module to explicitly render the view from
    prePostExempt - If true, pre/post layout interceptors will not be fired. By default they do fire
    Returns:
    The rendered layout

    listen

    public any listen(any target, any point)

    Register a closure listener as an interceptor on a specific point

    Parameters:
    target - The closure/lambda to register
    point - The interception point to register the listener to
    Returns:
    FrameworkSuperType

    loadApplicationHelpers

    public any loadApplicationHelpers([boolean force='false'])

    Load the global application helper libraries defined in the applicationHelper Setting of your application. This is called by the framework ONLY! Use at your own risk

    Parameters:
    force - Used when called by a known virtual inheritance family tree.
    Returns:
    FrameworkSuperType

    locateDirectoryPath

    public string locateDirectoryPath(any pathToCheck)

    Resolve a directory to be either relative or absolute in your application

    Parameters:
    pathToCheck - The file path to check

    locateFilePath

    public string locateFilePath(any pathToCheck)

    Resolve a file to be either relative or absolute in your application

    Parameters:
    pathToCheck - The file path to check

    persistVariables

    public any persistVariables([any persist=''], [struct persistStruct='[runtime expression]'])

    Persist variables into the Flash RAM

    Parameters:
    persist - A list of request collection keys to persist
    persistStruct - A struct of key-value pairs to persist
    Returns:
    FrameworkSuperType

    populateModel

    public any populateModel(any model, [any scope=''], [boolean trustedSetter='false'], [any include=''], [any exclude=''], [boolean ignoreEmpty='false'], [any nullEmptyInclude=''], [any nullEmptyExclude=''], [boolean composeRelationships='false'], [struct memento='[runtime expression]'], [string jsonstring], [string xml], [query qry])

    Populate a model object from the request Collection or a passed in memento structure

    Parameters:
    model - The name of the model to get and populate or the acutal model object. If you already have an instance of a model, then use the populateBean() method
    scope - Use scope injection instead of setters population. Ex: scope=variables.instance.
    trustedSetter - If set to true, the setter method will be called even if it does not exist in the object
    include - A list of keys to include in the population
    exclude - A list of keys to exclude in the population
    ignoreEmpty - Ignore empty values on populations, great for ORM population
    nullEmptyInclude - A list of keys to NULL when empty
    nullEmptyExclude - A list of keys to NOT NULL when empty
    composeRelationships - Automatically attempt to compose relationships from memento
    memento - A structure to populate the model, if not passed it defaults to the request collection
    jsonstring - If you pass a json string, we will populate your model with it
    xml - If you pass an xml string, we will populate your model with it
    qry - If you pass a query, we will populate your model with it
    Returns:
    The instance populated

    relocate

    public void relocate([any event], [any URL], [any URI], [any queryString], [any persist], [struct persistStruct], [boolean addToken], [boolean ssl], [any baseURL], [boolean postProcessExempt], [numeric statusCode])

    Relocate user browser requests to other events, URLs, or URIs.

    Parameters:
    event - The name of the event to run, if not passed, then it will use the default event found in your configuration file
    URL - The full URL you would like to relocate to instead of an event: ex: URL='http://www.google.com'
    URI - The relative URI you would like to relocate to instead of an event: ex: URI='/mypath/awesome/here'
    queryString - The query string or struct to append, if needed. If in SES mode it will be translated to convention name value pairs
    persist - What request collection keys to persist in flash ram
    persistStruct - A structure key-value pairs to persist in flash ram
    addToken - Wether to add the tokens or not. Default is false
    ssl - Whether to relocate in SSL or not
    baseURL - Use this baseURL instead of the index.cfm that is used by default. You can use this for ssl or any full base url you would like to use. Ex: https://mysite.com/index.cfm
    postProcessExempt - Do not fire the postProcess interceptors
    statusCode - The status code to use in the relocation

    renderExternalView Deprecated

    public any renderExternalView(any view, [struct args='[runtime expression]'], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'])

    Renders an external view anywhere that cfinclude works.

    Deprecated:
    Use `externalView()` instead
    Parameters:
    view - The the view to render
    args - A struct of arguments to pass into the view for rendering, will be available as 'args' in the view.
    cache - Cached the view output or not, defaults to false
    cacheTimeout - The time in minutes to cache the view
    cacheLastAccessTimeout - The time in minutes the view will be removed from cache if idle or requested
    cacheSuffix - The suffix to add into the cache entry for this view rendering
    cacheProvider - The provider to cache this view in, defaults to 'template'
    Returns:
    The rendered view

    renderLayout Deprecated

    public any renderLayout([any layout], [any module=''], [any view=''], [struct args='[runtime expression]'], [any viewModule=''], [boolean prePostExempt='false'])

    Render a layout or a layout + view combo

    Deprecated:
    Use `layout()` instead
    Parameters:
    layout - The layout to render out
    module - The module to explicitly render this layout from
    view - The view to render within this layout
    args - An optional set of arguments that will be available to this layouts/view rendering ONLY
    viewModule - The module to explicitly render the view from
    prePostExempt - If true, pre/post layout interceptors will not be fired. By default they do fire
    Returns:
    The rendered layout

    renderView Deprecated

    public any renderView([any view=''], [struct args='[runtime expression]'], [any module=''], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'], [any collection], [any collectionAs=''], [numeric collectionStartRow='1'], [numeric collectionMaxRows='0'], [any collectionDelim=''], [boolean prePostExempt='false'], [any name])

    Render out a view

    Deprecated:
    Use view() instead
    Parameters:
    view - The the view to render, if not passed, then we look in the request context for the current set view.
    args - A struct of arguments to pass into the view for rendering, will be available as 'args' in the view.
    module - The module to render the view from explicitly
    cache - Cached the view output or not, defaults to false
    cacheTimeout - The time in minutes to cache the view
    cacheLastAccessTimeout - The time in minutes the view will be removed from cache if idle or requested
    cacheSuffix - The suffix to add into the cache entry for this view rendering
    cacheProvider - The provider to cache this view in, defaults to 'template'
    collection - A collection to use by this Renderer to render the view as many times as the items in the collection (Array or Query)
    collectionAs - The name of the collection variable in the partial rendering. If not passed, we will use the name of the view by convention
    collectionStartRow - The start row to limit the collection rendering with
    collectionMaxRows - The max rows to iterate over the collection rendering with
    collectionDelim - A string to delimit the collection renderings by
    prePostExempt - If true, pre/post view interceptors will not be fired. By default they do fire
    name - The name of the rendering region to render out, Usually all arguments are coming from the stored region but you override them using this function's arguments.
    Returns:
    The rendered view

    runEvent

    public any runEvent([any event=''], [boolean prePostExempt='false'], [boolean private='false'], [boolean defaultEvent='false'], [struct eventArguments='[runtime expression]'], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'])

    Executes events with full life-cycle methods and returns the event results if any were returned.

    Parameters:
    event - The event string to execute, if nothing is passed we will execute the application's default event.
    prePostExempt - If true, pre/post handlers will not be fired. Defaults to false
    private - Execute a private event if set, else defaults to public events
    defaultEvent - The flag that let's this service now if it is the default event running or not. USED BY THE FRAMEWORK ONLY
    eventArguments - A collection of arguments to passthrough to the calling event handler method
    cache - Cached the output of the runnable execution, defaults to false. A unique key will be created according to event string + arguments.
    cacheTimeout - The time in minutes to cache the results
    cacheLastAccessTimeout - The time in minutes the results will be removed from cache if idle or requested
    cacheSuffix - The suffix to add into the cache entry for this event rendering
    cacheProvider - The provider to cache this event rendering in, defaults to 'template'
    Returns:
    null or anything produced from the event

    runRoute

    public any runRoute(any name, [struct params='[runtime expression]'], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'], [boolean prePostExempt='false'])

    Executes internal named routes with or without parameters. If the named route is not found or the route has no event to execute then this method will throw an `InvalidArgumentException`. If you need a route from a module then append the module address: `@moduleName` or prefix it like in run event calls `moduleName:routeName` in order to find the right route. The route params will be passed to events as action arguments much how eventArguments work.

    Parameters:
    name - The name of the route
    params - The parameters of the route to replace
    cache - Cached the output of the runnable execution, defaults to false. A unique key will be created according to event string + arguments.
    cacheTimeout - The time in minutes to cache the results
    cacheLastAccessTimeout - The time in minutes the results will be removed from cache if idle or requested
    cacheSuffix - The suffix to add into the cache entry for this event rendering
    cacheProvider - The provider to cache this event rendering in, defaults to 'template'
    prePostExempt - If true, pre/post handlers will not be fired. Defaults to false
    Returns:
    null or anything produced from the route
    Throws:
    InvalidArgumentException

    setController

    public any setController(any controller)

    Parameters:
    controller

    setSetting

    public any setSetting(any name, any value)

    Set a new setting in the system

    Parameters:
    name - The key of the setting
    value - The value of the setting
    Returns:
    FrameworkSuperType

    settingExists

    public boolean settingExists(any name)

    Check if the setting exists in the application

    Parameters:
    name - The key of the setting

    view

    public any view([any view=''], [struct args='[runtime expression]'], [any module=''], [boolean cache='false'], [any cacheTimeout=''], [any cacheLastAccessTimeout=''], [any cacheSuffix=''], [any cacheProvider='template'], [any collection], [any collectionAs=''], [numeric collectionStartRow='1'], [numeric collectionMaxRows='0'], [any collectionDelim=''], [boolean prePostExempt='false'], [any name])

    Render out a view

    Parameters:
    view - The the view to render, if not passed, then we look in the request context for the current set view.
    args - A struct of arguments to pass into the view for rendering, will be available as 'args' in the view.
    module - The module to render the view from explicitly
    cache - Cached the view output or not, defaults to false
    cacheTimeout - The time in minutes to cache the view
    cacheLastAccessTimeout - The time in minutes the view will be removed from cache if idle or requested
    cacheSuffix - The suffix to add into the cache entry for this view rendering
    cacheProvider - The provider to cache this view in, defaults to 'template'
    collection - A collection to use by this Renderer to render the view as many times as the items in the collection (Array or Query)
    collectionAs - The name of the collection variable in the partial rendering. If not passed, we will use the name of the view by convention
    collectionStartRow - The start row to limit the collection rendering with
    collectionMaxRows - The max rows to iterate over the collection rendering with
    collectionDelim - A string to delimit the collection renderings by
    prePostExempt - If true, pre/post view interceptors will not be fired. By default they do fire
    name - The name of the rendering region to render out, Usually all arguments are coming from the stored region but you override them using this function's arguments.
    Returns:
    The rendered view

    when

    public any when(boolean target, any success, [any failure])

    Functional construct for if statements

    Parameters:
    target - The boolean evaluator, this can be a boolean value
    success - The closure/lambda to execute if the boolean value is true
    failure - The closure/lambda to execute if the boolean value is false
    Returns:
    Returns the SuperType object for chaining