to_java, add_type_field=True, python_class_name: Optional[str] = None)[source]

Encodes the given value as nothing not more complex than simple dict of either dicts, lists or builtin numeric or string values

  • value – Any object

  • add_type_field – If true, the PYTHON_CLASS_IDENTIFIER will be added with the python class field on it

  • python_class_name – It given it overrides the class name written when add_type_field is True otherwise, the class name will be inferred as the __class__ of value.


  • All iterables are converted to lists when deep is true.

  • If the value object has a to_java member, it will be called to do the conversion, otherwise its __dict__ or __slots__ member will be used.

See also