How do I define the type of a newly created class attribute?

I wrote a piece of code to create a new class. Now I wish to add attributes to it. The attributes have names, descriptions and types. However, I am unable to figure out how to add the type. I tried a few ways, one of which is included below.
image

However, I get this error:
image

I printed all the possible data types and have been trying to use their objects.

Could someone please help me in adding the type to the attribute?

You can use:

newAttr.get_java_object().setAbstractType(item.get_java_object())

I think there is a bug in the API.

1 Like

Thank you, that works.

1 Like