Skip to content
Advertisement

How to access “types” dynamically with java?

I don’t know what types.DocumentType is, but I’m doing an integration of an sdk and I created a cordova plugin. the import from the sdk is like this:

JavaScript

Can I somehow pass RG_FRENTE dynamically as it is done in javascript?

Something like:

JavaScript

Advertisement

Answer

This solution is only if DocumentType is enum class like below.

JavaScript

You can directly get by the valueOf method like below.

JavaScript

Or like this, if you have it in variable.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement