@staticmethod
def recast(val, datatype):
    """ Re-cast the value based upon an AWS supplied datatype
            and treat nulls sensibly.
        """
    ret_val = val
    if datatype == 'string':
        ret_val = str(val)
    elif datatype == 'boolean':
        if val.isdigit():
            ret_val = bool(int(val))
        elif val == 'TRUE':
            ret_val = True
        elif val == 'FALSE':
            ret_val = False
    elif datatype == 'integer':
        if val.isdigit():
            ret_val = int(val)
    elif datatype == 'float':
        ret_val = float(val) if val else 0.0
    return ret_val
