def get_as_map(self):
        """
        Converts object value into AnyMap or returns empty AnyMap if conversion is not possible.

        :return: AnyMap value or empty AnyMap if conversion is not supported.
        """
        return AnyValueMap.from_value(self.value)
Пример #2
0
    def get_as_map(self, index):
        """
        Converts array element into an AnyValueMap or returns empty AnyValueMap if conversion is not possible.

        :param index: an index of element to get.

        :return: AnyValueMap value of the element or empty AnyValueMap if conversion is not supported.
        """
        value = self[index]
        return AnyValueMap.from_value(value)