code: def to_java_state_descriptor(state_descriptor: StateDescriptor):
      if isinstance(
          state_descriptor,
          (
              ValueStateDescriptor,
              ReducingStateDescriptor,
              AggregatingStateDescriptor,
          ),
      ):
          value_type_info = to_java_typeinfo(state_descriptor.type_info)
          j_state_descriptor = JValueStateDescriptor(
              state_descriptor.name, value_type_info
          )
  
      elif isinstance(state_descriptor, ListStateDescriptor):
          element_type_info = to_java_typeinfo(
              state_descriptor.type_info.elem_type
          )
          j_state_descriptor = JListStateDescriptor(
              state_descriptor.name, element_type_info
          )
  
      elif isinstance(state_descriptor, MapStateDescriptor):
          key_type_info = to_java_typeinfo(
              state_descriptor.type_info._key_type_info
          )
          value_type_info = to_java_typeinfo(
              state_descriptor.type_info._value_type_info
          )
          j_state_descriptor = JMapStateDescriptor(
              state_descriptor.name, key_type_info, value_type_info
          )
      else:
          raise Exception(
              "Unknown supported state_descriptor {0}".format(
                  state_descriptor
              )
          )
  
      if state_descriptor._ttl_config:
          j_state_ttl_config = to_java_state_ttl_config(
              state_descriptor._ttl_config
          )
          j_state_descriptor.enableTimeToLive(j_state_ttl_config)
  
      return j_state_descriptor
  
imports: from pemja import findClass
  from pyflink.common.typeinfo import TypeInformation, Types, BasicTypeInfo, BasicType, PrimitiveArrayTypeInfo, BasicArrayTypeInfo, ObjectArrayTypeInfo, MapTypeInfo
  from pyflink.datastream.state import StateDescriptor, ValueStateDescriptor, ReducingStateDescriptor, AggregatingStateDescriptor, ListStateDescriptor, MapStateDescriptor, StateTtlConfig
label_desc: Use image node_id 3 for calling a global function with example usage: to_java_state_descriptor(state_descriptor) and returns: j_state_descriptor