@staticmethod
def to_nullable_map(value):
    """
        Converts value into map object or returns null when conversion is not possible.

        :param value: the value to convert.

        :return: map object or null when conversion is not supported.
        """
    if isinstance(value, dict):
        return value
    elif hasattr(value, '_ast'):
        return value._ast()
    elif hasattr(value, '__iter__'):
        data = {}
        index = 0
        for v in value:
            data[str(index)] = v
            index += 1
        return data
    elif hasattr(value, '__dict__'):
        data = {}
        for k in dir(value):
            v = getattr(value, k)
            if not callable(v) and not k.startswith('_'):
                data[k] = v
        return data
    else:
        return None
